visibility; } /** * Check if the backend is visible for a user type * * @param int $visibility * @return bool */ public function isVisibleFor($visibility) { if ($this->visibility & $visibility) { return true; } return false; } /** * @param int $visibility * @return self */ public function setVisibility($visibility) { $this->visibility = $visibility; $this->allowedVisibility |= $visibility; return $this; } /** * @param int $visibility * @return self */ public function addVisibility($visibility) { return $this->setVisibility($this->visibility | $visibility); } /** * @param int $visibility * @return self */ public function removeVisibility($visibility) { return $this->setVisibility($this->visibility & ~$visibility); } /** * @return int */ public function getAllowedVisibility() { return $this->allowedVisibility; } /** * Check if the backend is allowed to be visible for a user type * * @param int $allowedVisibility * @return bool */ public function isAllowedVisibleFor($allowedVisibility) { if ($this->allowedVisibility & $allowedVisibility) { return true; } return false; } /** * @param int $allowedVisibility * @return self */ public function setAllowedVisibility($allowedVisibility) { $this->allowedVisibility = $allowedVisibility; $this->visibility &= $allowedVisibility; return $this; } /** * @param int $allowedVisibility * @return self */ public function addAllowedVisibility($allowedVisibility) { return $this->setAllowedVisibility($this->allowedVisibility | $allowedVisibility); } /** * @param int $allowedVisibility * @return self */ public function removeAllowedVisibility($allowedVisibility) { return $this->setAllowedVisibility($this->allowedVisibility & ~$allowedVisibility); } }