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


PHP SimpleORMap::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Initialize a new directory entry object for the given id.
  *
  * @param string $id  directory entry id
  * @throws InvalidArgumentException if id of directory entry is invalid
  */
 public function __construct($id = null)
 {
     parent::__construct($id);
     if ($id !== null && $this->isNew()) {
         throw new InvalidArgumentException('directory entry not found');
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:13,代码来源:DirectoryEntry.php

示例2: __construct

 /**
  * Give primary key of record as param to fetch
  * corresponding record from db if available, if not preset primary key
  * with given value. Give null to create new record
  *
  * @param mixed $id primary key of table
  */
 public function __construct($id = null)
 {
     $this->db_table = 'seminar_tabs';
     $this->belongs_to['course'] = array('class_name' => '\\Course', 'foreign_key' => 'seminar_id');
     // workaround for Stud.IP ticket:5312
     //$options = $this->getRelationOptions('course');
     //$options = $this->getRelationOptions('parent');
     /**
             $this->has_many['children'] = array(
                 'class_name'        => 'Mooc\\DB\\Block',
                 'assoc_foreign_key' => 'parent_id',
                 'assoc_func'        => 'findByParent_id',
                 'on_delete'         => 'delete',
                 'on_store'          => 'store'
             );
     
             $this->registerCallback('before_create', 'ensureSeminarId');
             $this->registerCallback('before_create', 'ensurePositionId');
             $this->registerCallback('before_store',  'validate');
     
             $this->registerCallback('after_delete',  'destroyFields');
             $this->registerCallback('after_delete',  'destroyUserProgress');
             $this->registerCallback('after_delete',  'updatePositionsAfterDelete');
     
             $events = words('after_create after_update after_store after_delete');
             $this->registerCallback($events, 'callbackToMetrics');
     		**/
     parent::__construct($id);
 }
开发者ID:anantace,项目名称:SeminarTabs,代码行数:36,代码来源:SeminarTab.class.php

示例3:

 function __construct($id = null)
 {
     $this->db_table = 'blubber_external_contact';
     //$this->registerCallback('before_store', 'cbSerializeData');
     //$this->registerCallback('after_store after_initialize', 'cbUnserializeData');
     parent::__construct($id);
 }
开发者ID:noackorama,项目名称:blubberforum,代码行数:7,代码来源:BlubberExternalContact.class.php

示例4: __construct

 public function __construct($id = null)
 {
     $this->db_table = 'doc_filetype_forbidden';
     $this->belongs_to['userConfig'] = array('class_name' => 'DocUsergroupConfig', 'foreign_key' => 'usergroup');
     $this->belongs_to['filetype'] = array('class_name' => 'DocFiletype', 'foreign_key' => 'dateityp_id');
     parent::__construct($id);
 }
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:DocFileTypeForbidden.class.php

示例5:

 function __construct($id = null)
 {
     if (version_compare($GLOBALS['SOFTWARE_VERSION'], "3.2", "<")) {
         $this->registerCallback('before_store', 'cbSerializeData');
         $this->registerCallback('after_store after_initialize', 'cbUnserializeData');
     }
     parent::__construct($id);
 }
开发者ID:Krassmus,项目名称:Fleximport,代码行数:8,代码来源:FleximportTable.php

示例6: __construct

 /**
  * Constructor of the object. Provides a fallback if a url is passed
  * instead of the usually expected numeric id in order to not break
  * backward compatibility.
  * But this constructor will fail miserably if a url is passed that
  * is not in the database. This was chosen by design to encourage the
  * correct use of an id.
  *
  * @param mixed $id Numeric id, existing url or null
  */
 public function __construct($id = null)
 {
     // Try to find matching id when an url is passed instead of an id.
     // This is to ensure that no legacy code will immediately break.
     if ($id !== null && !ctype_digit($id)) {
         $temp = self::findOneByUrl($id);
         if ($temp) {
             $id = $temp->id;
         }
     }
     parent::__construct($id);
 }
开发者ID:ratbird,项目名称:hope,代码行数:22,代码来源:OpenGraphURL.class.php

示例7: __construct

 public function __construct($id = null)
 {
     $this->db_table = 'doc_filetype';
     
     $this->has_many['forbiddenTypes'] = array(
         'class_name' => 'DocFileTypeForbidden',
         'on_delete'  => 'delete',
         'on_store'   => 'store',
     );
     
     parent::__construct($id);
     
     
 }
开发者ID:ratbird,项目名称:hope,代码行数:14,代码来源:DocFiletype.class.php

示例8: __construct

 public function __construct($id = null)
 {
     parent::__construct($id);
     $this->registerCallback('after_store before_delete', function ($notification) {
         $query = "SELECT user_id\n                      FROM personal_notifications_user\n                      WHERE personal_notification_id = :id";
         $statement = DBManager::get()->prepare($query);
         $statement->bindValue(':id', $notification->id);
         $statement->execute();
         $user_ids = $statement->fetchAll(PDO::FETCH_COLUMN);
         foreach ($user_ids as $user_id) {
             PersonalNotifications::expireCache($user_id);
         }
     });
 }
开发者ID:ratbird,项目名称:hope,代码行数:14,代码来源:PersonalNotifications.class.php

示例9: __construct

 /**
  * Defines the associated database table, relation to the schedule
  * and appropriate callbacks to encode/decode a possible exception.
  *
  * @param mixed $id Id of the log entry in question or null for a new entry
  */
 public function __construct($id = null)
 {
     $this->registerCallback('before_store after_store after_initialize', 'cbSerializeException');
     parent::__construct($id);
 }
开发者ID:ratbird,项目名称:hope,代码行数:11,代码来源:CronjobLog.class.php

示例10:

 function __construct($id = null)
 {
     $this->registerCallback('after_store', 'afterStoreCallback');
     parent::__construct($id);
 }
开发者ID:Krassmus,项目名称:LehrMarktplatz,代码行数:5,代码来源:LernmarktplatzComment.php

示例11: __construct

 public function __construct($id = null)
 {
     $this->db_table = 'doc_usergroup_config';
     parent::__construct($id);
 }
开发者ID:ratbird,项目名称:hope,代码行数:5,代码来源:DocUsergroupConfig.class.php

示例12:

 function __construct($id = null)
 {
     parent::__construct($id);
     $this->registerCallback('before_create', 'cbDefaultValues');
 }
开发者ID:ratbird,项目名称:hope,代码行数:5,代码来源:EventData.class.php

示例13: array

 function __construct($id = array())
 {
     $this->db_table = 'help_tour_audiences';
     parent::__construct($id);
 }
开发者ID:ratbird,项目名称:hope,代码行数:5,代码来源:HelpTourAudience.class.php

示例14: __construct

 /**
  * constructor
  * @param string/null $id : id of blubber-stream
  */
 public function __construct($id = null)
 {
     $this->db_table = "blubber_streams";
     $this->registerCallback('before_store', 'serializeData');
     $this->registerCallback('after_store after_initialize', 'unserializeData');
     $this->user_id = $GLOBALS['user']->id;
     parent::__construct($id);
 }
开发者ID:ratbird,项目名称:hope,代码行数:12,代码来源:BlubberStream.class.php

示例15: __construct

 /**
  * Overrides the contructor of SimpleORMap and is used in the exact same way.
  * Adds a virtual field to the posting giving the time of the newest comment
  * to the thread (or the thread.mkdate if no comment exists).
  * @param null|string $id
  */
 public function __construct($id = null)
 {
     $this->additional_fields['discussion_time']['get'] = function ($posting) {
         if ($posting['topic_id'] === $posting['root_id']) {
             $db = DBManager::get();
             return $db->query("SELECT GREATEST(MAX(blubber.mkdate),  IFNULL(MAX(blubber_reshares.chdate), 0)) " . "FROM blubber " . "LEFT JOIN blubber_reshares ON (blubber_reshares.topic_id = blubber.root_id) " . "WHERE root_id = " . $db->quote($posting->getId()) . " " . "GROUP BY blubber.root_id DESC " . "LIMIT 1 " . "")->fetch(PDO::FETCH_COLUMN, 0);
         } else {
             return $posting['mkdate'];
         }
     };
     $this->db_table = "blubber";
     $this->registerCallback('after_store', 'synchronizeHashtags');
     parent::__construct($id);
 }
开发者ID:ratbird,项目名称:hope,代码行数:20,代码来源:BlubberPosting.class.php


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