Пример #1
0
 public function createListOfPages()
 {
     $this->data['items'] = $this->getElementsWhereHasModel('pages', 'tags', $this->tagId, app('veer')->siteId, array("take_pages" => $this->number_of_items), true)->select('id', 'url', 'title', 'small_txt', 'views', 'created_at', 'users_id')->orderBy('manual_order', 'desc')->get();
     $this->data['tagName'] = \Cache::remember('tagNameId' . $this->tagId, 2, function () {
         return \Veer\Models\Tag::where('id', '=', $this->tagId)->pluck('name');
     });
 }
Пример #2
0
 protected function replaceFilterId($type, $filter_id)
 {
     if ($type == "attributes") {
         $a = \Veer\Models\Attribute::where('id', '=', $filter_id)->select('name', 'val')->first();
         if (is_object($a)) {
             $filter_id = $a->name . ":" . $a->val;
         }
     }
     if ($type == "tags") {
         $filter_id = \Veer\Models\Tag::where('id', '=', $filter_id)->pluck('name');
     }
     return $filter_id;
 }
Пример #3
0
 protected function renameTags($data)
 {
     if (!empty($data) || !is_array($data)) {
         return $this;
     }
     foreach ($data as $key => $value) {
         $value = trim($value);
         $tagDb = \Veer\Models\Tag::where('name', '=', $value)->first();
         if (!is_object($tagDb)) {
             // if the same value doesn't exist
             \Veer\Models\Tag::where('id', '=', $key)->update(['name' => $value]);
         }
     }
     return $this;
 }
Пример #4
0
 /**
  * Query Builder: 
  * 
  * - who: 1 Tag
  * - with: 
  * - to whom: make() | tag/{id}
  */
 public function getTag($id)
 {
     return \Veer\Models\Tag::where('id', '=', $id)->first();
 }