protected function validate($arr) { //job exists $collection = $this->readCollection(); if (isset($collection[self::VERSION]['jobs'][md5($arr['name'])])) { $this->error = 'You already have a job with this name'; return false; } return true; }