/** * Interal mechanism to add Actions to Module * * @param Module $model * @param mixed $data */ protected function doAddActions(Module $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Action'; } else { $related = ActionQuery::create()->findOneById($entry['id']); $model->addAction($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
/** * Declares an association between this object and a ChildModule object. * * @param ChildModule $v * @return $this|\keeko\core\model\Action The current object (for fluent API support) * @throws PropelException */ public function setModule(ChildModule $v = null) { if ($v === null) { $this->setModuleId(NULL); } else { $this->setModuleId($v->getId()); } $this->aModule = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildModule object, it will not be re-added. if ($v !== null) { $v->addAction($this); } return $this; }