protected function validate($action, $foreignModel, $foreignKey, array $data = array()) { $result = parent::validate($action, $foreignModel, $foreignKey, $data); if ($data[$this->context]['type'] != 'user') { $result = false; } return $result; }
public function add($action, $foreignModel, $foreignKey, array $data = array()) { $result = parent::validate($action, $foreignModel, $foreignKey, $data); if (!$data[$this->context]['published']) { $result = false; } return $result; }
protected function addComment($action, $foreignModel, $foreignKey, array $data = array()) { $result = parent::validate($action, $foreignModel, $foreignKey, $data); $projectEventModel = ClassRegistry::init('ProjectEvent'); if ($data[$this->context]['event_type'] != $projectEventModel::TASK_COMMENT) { $result = false; } return $result; }
public function requestTo($action, $foreignModel, $foreignKey, array $data = array()) { $result = parent::validate($action, $foreignModel, $foreignKey, $data); if ($result && $data[$this->context]['approved'] == true) { $result = true; } else { $result = false; } return $result; }
protected function close($action, $foreignModel, $foreignKey, array $data = array()) { $result = parent::validate($action, $foreignModel, $foreignKey, $data); if ($result && !empty($data[$this->context]['closed'])) { $result = true; } elseif ($result && empty($data[$this->context]['closed'])) { $result = false; } return $result; }