Beispiel #1
0
 /**
  * Constructs a new queue table
  * @param string $formAction URL where the form of the table will point to
  * @param string $detailAction URL where the action of a queue job will point to
  * @return null
  */
 public function __construct($formAction, $detailAction, $translator)
 {
     $model = ModelManager::getInstance()->getModel(QueueModel::NAME);
     parent::__construct($model, $formAction);
     $this->addDecorator(new ZebraDecorator(new DetailDecorator($detailAction)));
     $this->addDecorator(new StatusDecorator($translator));
 }
 /**
  * Constructs a new scaffold table
  * @param zibo\library\orm\model\Model $model Model for the data of the table
  * @param string $basePath URL to the base path of the table, this is also the URL where the form of the table will point to
  * @param boolean|array $search False to disable search, True to search all properties or an array with the fields to query
  * @param boolean|array $order False to disable order, True to order all properties or an array with the fields to order
  * @return null
  */
 public function __construct(Model $model, $basePath, $search = true, $order = true)
 {
     $this->basePath = $basePath;
     parent::__construct($model, $this->basePath);
     $this->meta = $model->getMeta();
     if ($this->meta->isLocalized()) {
         $this->query->setLocale(LocalizeController::getLocale());
         $this->query->setWillIncludeUnlocalizedData(ModelQuery::INCLUDE_UNLOCALIZED_FETCH);
         $this->query->setWillAddIsLocalizedOrder(true);
     }
     if ($search) {
         if ($search === true) {
             $search = array();
         }
         $this->setSearchFields($search);
     }
     if ($order) {
         if ($order === true) {
             $order = array();
         }
         $this->setOrderFields($order);
     }
 }