Pimcore\Model\Object\ClassDefinition::setPropertyVisibility PHP Method

setPropertyVisibility() public method

public setPropertyVisibility ( $propertyVisibility )
$propertyVisibility
    public function setPropertyVisibility($propertyVisibility)
    {
        if (is_array($propertyVisibility)) {
            $this->propertyVisibility = $propertyVisibility;
        }
        return $this;
    }

Usage Example

Example #1
0
 /**
  * @param null $id
  * @throws \Exception
  */
 public function getById($id = null)
 {
     if (!$id) {
         $id = $this->model->getId();
     }
     $classRaw = $this->db->fetchRow("SELECT * FROM classes WHERE id = ?", $id);
     if ($classRaw["id"]) {
         $this->assignVariablesToModel($classRaw);
         $this->model->setPropertyVisibility(Serialize::unserialize($classRaw["propertyVisibility"]));
         $this->model->setLayoutDefinitions($this->getLayoutData());
     } else {
         throw new \Exception("Class with ID " . $id . " doesn't exist");
     }
 }