/** * @Soap\Method("getNotes") * * @Soap\Param("page", phpType="int") * @Soap\Param("limit", phpType="int") * @Soap\Param("entityId", phpType="Oro\Bundle\EntityBundle\Model\EntityIdSoap") * @Soap\Result(phpType = "Oro\Bundle\NoteBundle\Entity\NoteSoap[]") * * @AclAncestor("oro_note_view") */ public function cgetAction(EntityIdSoap $entityId, $page = 1, $limit = 10) { /** @var NoteRepository $repo */ $repo = $this->getManager()->getRepository(); $qb = $repo->getAssociatedNotesQueryBuilder($entityId->getEntity(), $entityId->getId(), $page, $limit); $result = $qb->getQuery()->getResult(); return $this->transformToSoapEntities($result); }
/** * {@inheritdoc} */ public function find($id) { $result = parent::find($id); if (!$result) { throw new EntityNotFoundException(); } $entityId = null; $target = $result->getTarget(); if ($target) { $entityId = new EntityIdSoap(); $entityId->setEntity(ClassUtils::getClass($target))->setId($target->getId()); $result->entityId = $entityId; } else { throw new \LogicException('Note entity cannot be unassigned.'); } return $result; }