/** * Link a content type group with a content type * * @param mixed $groupId * @param mixed $contentTypeId * * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If group or type with provided status is not found * @throws \eZ\Publish\API\Repository\Exceptions\BadStateException If type is already part of group * @todo Above throws are not implemented */ public function link( $groupId, $contentTypeId, $status ) { $this->contentTypeGateway->insertGroupAssignment( $groupId, $contentTypeId, $status ); // @todo FIXME: What is to be returned? return true; }
/** * Insert assignment of $typeId to $groupId. * * @param mixed $typeId * @param int $status * @param mixed $groupId */ public function insertGroupAssignment($typeId, $status, $groupId) { try { return $this->innerGateway->insertGroupAssignment($typeId, $status, $groupId); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }