private function buildSrcEntity(&$citEntity, &$em) { $srcEntity = new Source(); $srcEntity->setDisplayName($citEntity->getTitle()); $srcEntity->setDescription($citEntity->getFullText()); $srcEntity->setYear($citEntity->getYear()); $srcEntity->setIsCitation(true); $srcEntity->setSourceType($em->getRepository('AppBundle:SourceType')->findOneBy(array('id' => 2))); $srcEntity->setCreatedBy($em->getRepository('AppBundle:User')->findOneBy(array('id' => '6'))); $this->transferInteractions($citEntity, $srcEntity, $em); //print("\n Interaction-- records transfered to new Source citation."); $this->transferAuthors($citEntity, $srcEntity, $em); //print("\n Authors-- contributed to the new Source citation."); $em->persist($srcEntity); return $srcEntity; }