Esempio n. 1
0
 public function __construct()
 {
     $doc = DBSimple::get(IndexPageModel::TableName, '');
     $doc = new IndexPageModel($doc);
     $this->sitemapInfo = $doc->getSiteMapData();
     $this->title = self::title;
     $this->begin = array(self::title => '#');
     $this->parent = intval($this->sitemapInfo['id']);
     $this->paging_size = self::pagingSize;
     parent::__construct();
 }
Esempio n. 2
0
 /**
  *   -------------------------------------------------------------------------------------------
  * @desc Сохраняет отсортированные данные
  * @return
  *   -------------------------------------------------------------------------------------------
  */
 public function order()
 {
     $typeName = $_POST['type'];
     $validator = new \Extasy\Validators\IsModelClassNameValidator($typeName);
     if (!$validator->isValid()) {
         throw new InvalidArgumentException('Not a model - ' . $typeName);
     }
     $aType = call_user_func([$typeName, 'getFieldsInfo']);
     $szIndex = call_user_func([$typeName, 'getIndexKey']);
     $i = 1;
     $aRows = explode("\n", $_POST['order_value']);
     unset($aRows[0]);
     foreach ($aRows as $value) {
         \Extasy\ORM\DBSimple::update($aType['table'], ['order' => $i], [$szIndex => $value]);
         $i++;
     }
     $this->afterOrder();
     $this->jump($this->jump_to);
 }
Esempio n. 3
0
 protected function seekIndexDocument()
 {
     $found = DBSimple::get(SITEMAP_TABLE, ['document_name' => $this->modelName]);
     return $found;
 }