Il giorno lunedì 31 agosto 2015 18:34:37 UTC+2, Anthony GRASSIOT ha scritto:
>
> Maybe something like:
>
>                 'compare' => [
>                     'rule' => function ($value, $context) {
>                         return $value->gte($context['data']['start_date']);
>                     }
>
>>
>> now the check was executed:
    public function validationDefault(Validator $validator)
    {
        $validator
            ->add('id', 'valid', ['rule' => 'numeric'])
            ->allowEmpty('id', 'create')
            ->add('social_user_id', 'valid', ['rule' => 'numeric'])
            ->allowEmpty('social_user_id')
            ->allowEmpty('name')
            ->allowEmpty('address')
            ->allowEmpty('city')
            ->add('lat', 'valid', ['rule' => 'numeric'])
            ->allowEmpty('lat')
            ->add('lng', 'valid', ['rule' => 'numeric'])
            ->allowEmpty('lng')
            ->add('start_date', 'valid', ['rule' => 'date'])
            ->add('end_date', 
                'custom',['rule' =>  [$this, 'checkDate']]
            );
            
        return $validator;
    } 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Reply via email to