I am having a bit of an issue with the new validator on CLI Task, probably I am doing something wrong.
php 5.5.9, phalcon 3, Xubuntu 14.04, package manager instalation
Line 124 is return $this->validate($validator);
public function validation()
{
$validator = new \Phalcon\Validation();
$validator->add(
['RELATED', 'RELATED_ID', 'bin_key64'],
new \Phalcon\Validation\Validator\Uniqueness()
);
return $this->validate($validator);
}
CLI error is has follows
PHP Fatal error: Uncaught exception 'BadMethodCallException' with message 'Wrong number of parameters' in /var/www/v2/app/models/Files.php:124
Stack trace:
#0 [internal function]: Phalcon\Mvc\Model->getRelated()
#1 [internal function]: Phalcon\Validation->getValue('RELATED')
#2 [internal function]: Phalcon\Validation\Validator\Uniqueness->isUniqueness(Object(Phalcon\Validation), Array)
#3 [internal function]: Phalcon\Validation\Validator\Uniqueness->validate(Object(Phalcon\Validation), Array)
#4 [internal function]: Phalcon\Validation->validate(NULL, Object(Files))
#5 /var/www/v2/app/models/Files.php(124): Phalcon\Mvc\Model->validate(Object(Phalcon\Validation))
#6 [internal function]: Files->validation()
#7 [internal function]: Phalcon\Mvc\Model->fireEventCancel('validation')
#8 [internal function]: Phalcon\Mvc\Model->_preSave(Object(Phalcon\Mvc\Model\MetaData\Memory), false, 'id')
#9 /var/www/v2/app/tasks/FileTask.php(346): Phalcon\Mvc\Model->save()
#10 /var/www/v2/app/tasks/File in /var/www/apqe/v2/app/models/Files.php on line 124