/** * Create a new UserHost in database * * @param integer $id * @param string $title * @param string $user * @param string $host * @param string $userExcluded * @param string $hostExcluded * @param mixed $info */ protected function createUserHost($id, $title, $user, $host, $userExcluded, $hostExcluded, $info = false) { /** @var UserHost $userHost */ $userHost = new UserHost(); $userHost->setId($id)->setUser($user)->setHost($host)->setUserExcluded($userExcluded)->setHostExcluded($hostExcluded)->setTitle($title); if ($info) { $userHost->setInfo($info); } else { $userHost->setInfo($title); } array_push($this->rights, $userHost); $this->manager->persist($userHost); $this->manager->flush(); }