Exemplo n.º 1
0
 /**
  * Get the data for the object from database for the given id, or from the ID which is set in the object
  *
  * @param integer $id
  * @return void
  */
 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(Pimcore_Tool_Serialize::unserialize($classRaw["propertyVisibility"]));
         $this->model->setLayoutDefinitions($this->getLayoutData());
     } else {
         throw new Exception("Class with ID " . $id . " doesn't exist");
     }
 }