/** * Get test config entity. * * @return ConfigEntity */ protected function _getConfigEntity() { if ($this->_testEntity) { return $this->_testEntity; } $group = new ConfigGroup(); $group->setName('testgroup')->setId(5); $entity = new ConfigEntity(); $entity->setName('test')->setConfiggroup($group)->setId(10)->setType(ConfigTypes::TYPE_STRING)->setValue('testvalue'); return $this->_testEntity = $entity; }
/** * Create group. * * @param string $name * * @return ConfigGroup */ protected function _createGroup($name) { /** @var $group ConfigGroup */ $name = strtolower($name); $group = $this->_getDoctrine()->getRepository('JeboehmLampcpCoreBundle:ConfigGroup')->findOneBy(array('name' => $name)); if (!$group) { $group = new ConfigGroup(); $group->setName($name); $this->_getDoctrine()->persist($group); $this->_getDoctrine()->flush(); } $this->_lastGroup = $group; return $group; }