protected function getTopMostParent(Asset $i) { $parent = $i->getParent(); while ($parent->getParent() instanceof Asset) { $parent = $parent->getParent(); } return $parent; }
public function getNestedAssets(Asset $asset) { return $this->createQueryBuilder('a')->select('a')->where('a.parent = :id')->andWhere('a.flag_id != :flag')->andWhere('a.flag_id != :flag2')->setParameter('id', $asset->getId())->setParameter('flag', 62)->setParameter('flag2', 0)->getQuery(); }
public function flattenAssets(Asset $asset) { $list = [$asset]; $this->helperFlatten($asset->getContents()->toArray(), $list); return $list; }
/** * Creates a form to delete a Asset entity. * * @param Asset $asset The Asset entity * * @return \Symfony\Component\Form\Form The form */ private function createDeleteForm(Asset $asset) { return $this->createFormBuilder()->setAction($this->generateUrl('asset_delete', array('id' => $asset->getId())))->setMethod('DELETE')->getForm(); }
/** * Remove files * * @param \AppBundle\Entity\Asset $files */ public function removeFile(\AppBundle\Entity\Asset $files) { $files->setSeries(Null); $this->files->removeElement($files); }