level = CompanyRoles::GUEST; $this->created = new \DateTime(); $this->updated = new \DateTime(); } /** * @param CustomUserInterface $user * @param CustomUserGroupInterface $group * @param int $level */ public function setDefault(CustomUserInterface $user, CustomUserGroupInterface $group, int $level = CompanyRoles::GUEST) { // TODO: Implement setDefault() method. $this->user = $user; $this->group = $group; $this->level = $level; } /** * @ORM\PrePersist * @ORM\PreUpdate */ public function updateSelf(){ $this->updated = new \DateTime(); } /** * @return int|mixed */ public function getId() { return $this->id; } /** * @return int */ public function getLevel(): int { return $this->level; } /** * @param int $level * @return $this */ public function setLevel(int $level) { $this->level = $level; return $this; } /** * @param bool $owner * @return $this */ public function setOwner(bool $owner) { $this->owner = $owner; return $this; } /** * @return bool */ public function isOwner(): bool { return $this->owner; } /** * @param CustomUserInterface $user * @return $this */ public function setUser(CustomUserInterface $user) { $this->user = $user; return $this; } /** * @return CustomUserInterface */ public function getUser(): CustomUserInterface { return $this->user; } /** * @return CustomUserGroupInterface */ public function getGroup(): CustomUserGroupInterface { return $this->group; } /** * @param CustomUserGroupInterface $group * @return $this */ public function setGroup(CustomUserGroupInterface $group) { $this->group = $group; return $this; } }