Inheritance: extends Pimcore\Model\AbstractModel
Ejemplo n.º 1
0
 /**
  * Loads a list of static routes for the specicifies parameters, returns an array of Staticroute elements
  *
  * @return array
  */
 public function load()
 {
     $itemsData = $this->db->fetchCol("SELECT id FROM recyclebin" . $this->getCondition() . $this->getOrder() . $this->getOffsetLimit(), $this->model->getConditionVariables());
     $items = array();
     foreach ($itemsData as $itemData) {
         $items[] = Model\Element\Recyclebin\Item::getById($itemData);
     }
     $this->model->setItems($items);
     return $items;
 }
 public function addAction()
 {
     $element = Element\Service::getElementById($this->getParam("type"), $this->getParam("id"));
     if ($element) {
         $type = Element\Service::getElementType($element);
         $listClass = "\\Pimcore\\Model\\" . ucfirst($type) . "\\Listing";
         $list = new $listClass();
         $list->setCondition(($type == "object" ? "o_" : "") . "path LIKE '" . $element->getFullPath() . "/%'");
         $children = $list->getTotalCount();
         if ($children <= 100) {
             Recyclebin\Item::create($element, $this->getUser());
         }
         $this->_helper->json(array("success" => true));
     } else {
         $this->_helper->json(array("success" => false));
     }
 }