当前位置: 首页>>代码示例>>PHP>>正文


PHP record_adapter::__construct方法代码示例

本文整理汇总了PHP中record_adapter::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP record_adapter::__construct方法的具体用法?PHP record_adapter::__construct怎么用?PHP record_adapter::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在record_adapter的用法示例。


在下文中一共展示了record_adapter::__construct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  *
  * @param Application $app
  * @param int         $sbas_id
  * @param int         $record_id
  * @param boolean     $deny
  * @param int         $order_master_id
  */
 public function __construct(Application $app, $sbas_id, $record_id, $deny, $order_master_id)
 {
     $this->deny = !!$deny;
     $this->order_master_id = $order_master_id;
     parent::__construct($app, $sbas_id, $record_id);
     $this->get_subdefs();
     return $this;
 }
开发者ID:luisbrito,项目名称:Phraseanet,代码行数:16,代码来源:orderElement.php

示例2: __construct

 /**
  *
  * @param Application $app
  * @param integer     $sbas_id
  * @param integer     $record_id
  * @param string      $directory
  * @param integer     $remain_hd
  *
  * @return record_exportElement
  */
 public function __construct(Application $app, $sbas_id, $record_id, $directory = '', $remain_hd = false)
 {
     $this->directory = $directory;
     if ($this->directory) {
         $unicode = new \unicode();
         $this->directory = $unicode->remove_nonazAZ09($this->directory) . '/';
     }
     $this->remain_hd = $remain_hd;
     $this->size = [];
     parent::__construct($app, $sbas_id, $record_id);
     $this->get_actions($remain_hd);
     return $this;
 }
开发者ID:nlegoff,项目名称:Phraseanet,代码行数:23,代码来源:exportElement.php

示例3: __construct

 /**
  *
  * @param Application           $app
  * @param string                $env
  * @param integer               $pos
  * @param mixed                 $contId
  * @param SearchEngineInterface $search_engine
  * @param string                $query
  *
  * @return record_preview
  */
 public function __construct(Application $app, $env, $pos, $contId, SearchEngineInterface $search_engine = null, $query = '', SearchEngineOptions $options = null)
 {
     $number = null;
     $this->env = $env;
     $this->app = $app;
     switch ($env) {
         case "RESULT":
             if (null === $search_engine) {
                 throw new \LogicException('Search Engine should be provided');
             }
             $results = $search_engine->query($query, (int) $pos, 1, $options);
             if ($results->getResults()->isEmpty()) {
                 throw new Exception('Record introuvable');
             }
             foreach ($results->getResults() as $record) {
                 $number = $pos;
                 $this->original_item = $record;
                 $sbas_id = $record->get_sbas_id();
                 $record_id = $record->get_record_id();
                 break;
             }
             break;
         case "REG":
             $contId = explode('_', $contId);
             $sbas_id = $contId[0];
             $record_id = $contId[1];
             $this->container = new record_adapter($app, $sbas_id, $record_id);
             $this->original_item = $this->container;
             if ($pos == 0) {
                 $number = 0;
             } else {
                 $children = $this->container->get_children();
                 foreach ($children as $child) {
                     $sbas_id = $child->get_sbas_id();
                     $this->original_item = $child;
                     $record_id = $child->get_record_id();
                     if ($child->get_number() == $pos) {
                         break;
                     }
                 }
                 $number = $pos;
                 $this->total = $children->get_count();
             }
             break;
         case "BASK":
             $Basket = $app['converter.basket']->convert($contId);
             $app['acl.basket']->hasAccess($Basket, $app['authentication']->getUser());
             /* @var $Basket Basket */
             $this->container = $Basket;
             $this->total = $Basket->getElements()->count();
             $i = 0;
             $first = true;
             foreach ($Basket->getElements() as $element) {
                 /* @var $element BasketElement */
                 $i++;
                 if ($first) {
                     $this->original_item = $element;
                     $sbas_id = $element->getRecord($this->app)->get_sbas_id();
                     $record_id = $element->getRecord($this->app)->get_record_id();
                     $this->name = $Basket->getName();
                     $number = $element->getOrd();
                 }
                 $first = false;
                 if ($element->getOrd() == $pos) {
                     $this->original_item = $element;
                     $sbas_id = $element->getRecord($this->app)->get_sbas_id();
                     $record_id = $element->getRecord($this->app)->get_record_id();
                     $this->name = $Basket->getName();
                     $number = $element->getOrd();
                 }
             }
             break;
         case "FEED":
             $entry = $app['repo.feed-entries']->find($contId);
             $this->container = $entry;
             $this->total = count($entry->getItems());
             $i = 0;
             $first = true;
             foreach ($entry->getItems() as $element) {
                 $i++;
                 if ($first) {
                     $sbas_id = $element->getRecord($this->app)->get_sbas_id();
                     $record_id = $element->getRecord($this->app)->get_record_id();
                     $this->name = $entry->getTitle();
                     $this->original_item = $element;
                     $number = $element->getOrd();
                 }
                 $first = false;
                 if ($element->getOrd() == $pos) {
//.........这里部分代码省略.........
开发者ID:nlegoff,项目名称:Phraseanet,代码行数:101,代码来源:preview.php


注:本文中的record_adapter::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。