/** * Creates a new instance of the Container entity and optional saves to the database. * * @param $name * @param string $friendlyName * @param bool|FALSE $persist * @return Container */ public function createContainer($name, $friendlyName = '', $persist = false) { $container = new Container(); $container->setName($name); $container->setFriendlyName($friendlyName); if ($persist) { $this->saveContainer($container); } return $container; }