Ejemplo n.º 1
0
 public function createPetitionInterval(UserPetition $userPetition, Group $petitionGroup, User $user, $expireInterval = self::EXPIRE_INTERVAL)
 {
     $currentDate = new \DateTime();
     $expireDate = clone $currentDate;
     $expireDate->add(new \DateInterval('P' . $expireInterval . 'D'));
     $userPetition->setPublishStatus(UserPetition::STATUS_USER);
     $userPetition->setUser($user);
     $userPetition->setGroup($petitionGroup);
     $userPetition->setCreatedAt($currentDate);
     $userPetition->setExpireAt($expireDate);
     $userPetition->setUserExpireInterval($expireInterval);
     return $userPetition;
 }
 public function setUser(\Civix\CoreBundle\Entity\User $user = NULL)
 {
     $this->__load();
     return parent::setUser($user);
 }