當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Link::all方法代碼示例

本文整理匯總了PHP中Link::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Link::all方法的具體用法?PHP Link::all怎麽用?PHP Link::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Link的用法示例。


在下文中一共展示了Link::all方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handler_links_admin

 function handler_links_admin($page)
 {
     if (!S::user()->perms()->hasFlag('admin')) {
         return PL_FORBIDDEN;
     }
     $collec = Link::all();
     $collec->select(LinkSelect::all());
     $results = $collec->split('ns');
     if (Env::has('modify')) {
         $id = Env::i('id');
         $link = $collec->get($id);
         if ($link !== false) {
             if (Env::has('image')) {
                 try {
                     $group = Group::from('partnership');
                     $group->select();
                     $image = new FrankizImage();
                     $image->insert();
                     $image->label($link->label());
                     $image->caste($group->caste('everybody'));
                     $image->image(FrankizUpload::v('image'));
                     $link->image($image);
                 } catch (Exception $e) {
                     $page->assign('err', $e->getMessage());
                 }
             }
             $link->label(Env::t('label'));
             $link->link(Env::t('link'));
             $link->description(Env::t('description'));
             $link->comment(Env::t('comment'));
         } else {
             $err = 'Le lien modifié n\'existe plus.';
             $page->assign('err', $err);
         }
     }
     $page->addCssLink('links.css');
     $page->assign('links', $results);
     $page->assign('title', 'Administrer les liens');
     $page->changeTpl('links/admin_links.tpl');
 }
開發者ID:netixx,項目名稱:frankiz,代碼行數:40,代碼來源:links.php

示例2: links

 /**
  * @before _secure
  * @after _displayData
  */
 public function links()
 {
     $this->seo(array("title" => "Link Logs"));
     $view = $this->getActionView();
     $prop = RM::get("property");
     $val = RM::get("value");
     $sort = RM::get("sort", "desc");
     $sign = RM::get("sign", "equal");
     $orderBy = RM::get("order", 'created');
     $fields = (new \Link())->getColumns();
     $searching = $query = [];
     $query['user_id'] = ['$in' => $this->org->users('publisher')];
     foreach ($fields as $key => $value) {
         $search = RM::get($key);
         if (!$search) {
             continue;
         }
         $searching[$key] = $search;
         // Only allow full object ID's and rest regex searching
         if (in_array($key, ['user_id', 'ad_id', '_id'])) {
             $query[$key] = RM::get($key);
         } else {
             $query[$key] = Utils::mongoRegex($search);
         }
     }
     $dateQuery = Utils::dateQuery(['start' => $this->start, 'end' => $this->end]);
     $query['created'] = ['$gte' => $dateQuery['start'], '$lte' => $dateQuery['end']];
     $records = \Link::all($query, [], $orderBy, $sort, $this->limit, $this->page);
     $count = \Link::count($query);
     $view->set(['links' => $records, 'fields' => $fields, 'property' => $prop, 'value' => $val, 'sign' => $sign, 'sort' => $sort, 'order' => $orderBy, 'count' => $count, 'query' => $searching]);
 }
開發者ID:vNative,項目名稱:vnative,代碼行數:35,代碼來源:report.php

示例3: run

 public function run()
 {
     $collec = Link::all('usefuls');
     $collec->select(LinkSelect::all());
     $this->assign('links', $collec);
 }
開發者ID:netixx,項目名稱:frankiz,代碼行數:6,代碼來源:links.php

示例4: link

 public function link()
 {
     return Link::all();
 }
開發者ID:Jv-Juven,項目名稱:opera-1,代碼行數:4,代碼來源:BaseController.php

示例5: _reportspub

 private function _reportspub($query, $start, $end, $limit, $page)
 {
     $view = $this->getActionView();
     $dateQuery = Utils::dateQuery(['start' => $start, 'end' => $end]);
     $links = \Link::all($query, [], 'created', 'desc', $limit, $page);
     $count = \Link::count($query);
     $query["created"] = Db::dateQuery($start, $end);
     $performances = \Performance::all($query, ['created', 'clicks', 'revenue'], 'created', 'desc');
     $in = [];
     foreach ($links as $l) {
         // only find clicks for the ads whose links are created
         $in[] = Utils::mongoObjectId($l->ad_id);
     }
     // find clicks
     $clickCol = Registry::get("MongoDB")->clicks;
     $records = Db::query('Click', ['adid' => ['$in' => $in], 'is_bot' => false, 'pid' => $query['user_id'], 'created' => $query['created']], ['adid', 'country']);
     $view->set(['limit' => $limit, 'page' => $page, 'count' => $count, 'start' => $start, 'end' => $end, 'links' => $links, 'performances' => $performances, 'clicks' => Click::classify($records, 'adid'), 'commission' => $this->user->commission(), 'dq' => $query['created']]);
 }
開發者ID:vNative,項目名稱:vnative,代碼行數:18,代碼來源:publisher.php

示例6: links

 private function links()
 {
     $class = get_class(new Link());
     $this->log($this->verb . ' Links');
     $url = $this->baseUrl . "facility_link?c:limit=1000";
     $data = $this->getCensusData($url);
     if (!$data) {
         return false;
     }
     // Collection of Eloquent objects from API
     $apiCollection = new Collection();
     foreach ($data->facility_link_list as $link) {
         $values = [];
         $values['name'] = isset($link->description) ? $link->description : null;
         $values['facility_id_a'] = isset($link->facility_id_a) ? $link->facility_id_a : null;
         $values['facility_id_b'] = isset($link->facility_id_b) ? $link->facility_id_b : null;
         $apiCollection->add(new Link($values));
     }
     $links = Link::all();
     $this->addModels($class, $links, $apiCollection);
     $this->deleteModels($class, $links, $apiCollection);
 }
開發者ID:ps2maps,項目名稱:ps2maps.com,代碼行數:22,代碼來源:Census.php


注:本文中的Link::all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。