public function buildRules(RulesChecker $rules)
    {
        return $rules->add($rules->existsIn(['category_id'], 'Categories', I18N_SELECT_VALID_OPTION))
            ->add($rules->existsIn(['user_id'], 'Users', I18N_SELECT_VALID_OPTION))
            ->add($rules->isUnique(['slug'], I18N_VALUE_ALREADY_USED))
            ->add($rules->isUnique(['title'], I18N_VALUE_ALREADY_USED));
    }
public function buildRules(RulesChecker $rules)
    {
        return $rules->add($rules->existsIn(['category_id'], 'Categories', I18N_SELECT_VALID_OPTION))
            ->add($rules->existsIn(['user_id'], 'Users', I18N_SELECT_VALID_OPTION))
            ->add($rules->isUnique(['slug'], I18N_VALUE_ALREADY_USED))
            ->add($rules->isUnique(['title'], I18N_VALUE_ALREADY_USED));
    }
public function buildRules ( RulesChecker $ rules ) { return $ rules -> add ( $ rules -> existsIn ( [ 'category_id' ] , 'Categories' , I18N_SELECT_VALID_OPTION ) ) -> add ( $ rules -> existsIn ( [ 'user_id' ] , 'Users' , I18N_SELECT_VALID_OPTION ) ) -> add ( $ rules -> isUnique ( [ 'slug' ] , I18N_VALUE_ALREADY_USED ) ) -> add ( $ rules -> isUnique ( [ 'title' ] , I18N_VALUE_ALREADY_USED ) ) ; }
Returns a rules checker object that will be used for validating
application integrity
@param \Cake\ORM\RulesChecker $rules The rules object to be modified
@return \Cake\ORM\RulesChecker
Returns a rules checker object that will be used for validating application integrity