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


PHP Eloquent::__construct方法代碼示例

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


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

示例1: __construct

 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     $this->primaryKey = Config::get('wordpress-auth-laravel::auth.id');
     $this->table = Config::get('wordpress-auth-laravel::auth.table');
     $this->hidden = array(Config::get('wordpress-auth-laravel::auth.password'));
 }
開發者ID:shankargiri,項目名稱:Quantum-Vic-La-Trobe-L4,代碼行數:7,代碼來源:User.php

示例2: __construct

 public function __construct(array $attributes = array())
 {
     // $db_fields_to_import = DaisyconHelper::db_fields_to_import();
     // $custom_db_fields_to_import = Config::get('daisycon.custom_db_fields_to_import');
     $this->fillable(array_merge(DaisyconHelper::getDatabaseFields(), array('program_id', 'feed_id', 'custom_categorie')));
     parent::__construct($attributes);
 }
開發者ID:bahjaat,項目名稱:daisycon,代碼行數:7,代碼來源:Data.php

示例3: __construct

 /**
  * Construct
  * 
  * @param array   $attributes
  * @param boolean $exists
  */
 public function __construct($attributes = array(), $exists = false)
 {
     parent::__construct($attributes, $exists);
     // Set the prefix
     $prefix = \Config::get('verify::verify.prefix');
     $this->prefix = $prefix ? $prefix . '_' : '';
 }
開發者ID:marmaray,項目名稱:OLD-laravel-France-website,代碼行數:13,代碼來源:eloquentverifybase.php

示例4: __construct

 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     $this->errors = new \Illuminate\Support\MessageBag();
     $this->validator = \App::make('validator');
     $this->manejaConcurrencia = true;
 }
開發者ID:richarrieta,項目名稱:miequipo,代碼行數:7,代碼來源:BaseModel.php

示例5: __construct

 /**
  * Create a new Eloquent model instance.
  *
  * @param  array  $attributes
  * @return void
  */
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     // Set the prefix
     $this->prefix = \Config::get('leback-auth::prefix', 'test');
     $this->table = $this->prefix . $this->getTable();
 }
開發者ID:gxela,項目名稱:leback-auth,代碼行數:13,代碼來源:BaseModel.php

示例6: __construct

 public function __construct(array $attributes = array())
 {
     $this->hasAttachedFile('avatar', ['styles' => ['medium' => '300x300', 'thumbCrop' => '120x120#']]);
     $this->hasAttachedFile('cover', ['styles' => ['standard' => '1200x250', 'standardCrop' => '1200x250#']]);
     $this->hasAttachedFile('presentation_cover', ['styles' => ['standard' => '1200']]);
     parent::__construct($attributes);
 }
開發者ID:itsfamestudio,項目名稱:hashtag,代碼行數:7,代碼來源:Board.php

示例7: __construct

 public function __construct($attributes = array())
 {
     parent::__construct($attributes);
     if ($this->useSti()) {
         $this->setAttribute($this->stiClassField, get_class($this));
     }
 }
開發者ID:WillyMaciel,項目名稱:fwt,代碼行數:7,代碼來源:BaseModel.php

示例8: __construct

 /**
  * Prefixes any tables that need it
  */
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     static::$dbprefix = \Config::get('empower::dbprefix');
     // Change any unique:table_name or exists:table_name to prefixed table names
     static::$rules = preg_replace(array('/exists:(?:' . static::$dbprefix . '|)/', '/unique:(?:' . static::$dbprefix . '|)/'), array('exists:' . static::$dbprefix, 'unique:' . static::$dbprefix), static::$rules);
     $this->table = static::$dbprefix . $this->table;
 }
開發者ID:sorora,項目名稱:empower,代碼行數:11,代碼來源:SupportModel.php

示例9: __construct

 /**
  * Create a new Eloquent model instance.
  *
  * @param array $attributes
  * @return void
  */
 public function __construct(array $attributes = array())
 {
     /**
      * The database table used by the model.
      */
     $this->table = \Config::get('gponster/laravel-facebook-sdk::profile.table');
     parent::__construct($attributes);
 }
開發者ID:gponster,項目名稱:laravel-facebook-sdk,代碼行數:14,代碼來源:Profile.php

示例10: __construct

 /**
  * Create a new Eloquent model instance, ensuring that any auditing
  * columns are guarded.
  *
  * @param  array  $attributes
  * @return void
  */
 public function __construct(array $attributes = array())
 {
     // if we're using the auditing trait, guard the audit columns
     $reflection = new \ReflectionClass($this);
     if (array_key_exists('BishopB\\Forum\\AuditingTrait', $reflection->getTraits())) {
         $this->guarded = $this->guarded + $this->getAuditors();
     }
     parent::__construct($attributes);
 }
開發者ID:bishopb,項目名稱:laravel-forums,代碼行數:16,代碼來源:BaseModel.php

示例11: __construct

 public function __construct()
 {
     parent::__construct();
     $config = Config::get('app.txtMsg');
     $this->sendUrl = $config['url'];
     $this->apiKey = $config['key'];
     $this->apiPass = $config['pass'];
     $this->apiId = $config['id'];
 }
開發者ID:qnck,項目名稱:qingnianchuangke,代碼行數:9,代碼來源:TxtMessage.php

示例12: __construct

 /**
  * AbstractTranslatableModel constructor.
  * @param array $attributes
  */
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     if (empty($this->translationModel) || empty($this->translationForeignKey) || empty($this->translatedAttributes)) {
         throw new \Exception('This model requires these attributes must be set to work normally :
         "translationModel", "translationForeignKey", "translatedAttributes"');
         //see comments below for sample
     }
     $this->initListify();
 }
開發者ID:trungtnm,項目名稱:backend,代碼行數:14,代碼來源:AbstractTranslatableModel.php

示例13: __construct

 public function __construct()
 {
     $this->title = '';
     $this->description = '';
     $this->has_dimension = false;
     $this->has_budget = false;
     $this->dimension = '';
     $this->budget = '';
     $this->type = 'draft';
     parent::__construct();
 }
開發者ID:jaymondigo,項目名稱:custommade,代碼行數:11,代碼來源:Project.php

示例14: __construct

 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     // Create class methods on the fly.
     foreach (static::$states as $state) {
         $method = camel_case("is {$state}");
         $this->addMethod($method, function () use($state) {
             return $this->state == $state;
         });
     }
 }
開發者ID:sagaciresearch,項目名稱:adtracking,代碼行數:11,代碼來源:Tracking.php

示例15: __construct

 public function __construct(array $attributes = [], $options = [])
 {
     foreach ($options as $key => $value) {
         if ($value) {
             $propertyName = 'fake' . studly_case($key);
             self::${$propertyName} = $value;
         }
     }
     $this->table = self::$fakeTable;
     $this->connection = self::$fakeConnection;
     $this->primaryKey = self::$fakePrimaryKey;
     parent::__construct($attributes);
 }
開發者ID:marcmascarell,項目名稱:laravel-artificer,代碼行數:13,代碼來源:FakeModel.php


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