本文整理汇总了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'));
}
示例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);
}
示例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 . '_' : '';
}
示例4: __construct
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$this->errors = new \Illuminate\Support\MessageBag();
$this->validator = \App::make('validator');
$this->manejaConcurrencia = true;
}
示例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();
}
示例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);
}
示例7: __construct
public function __construct($attributes = array())
{
parent::__construct($attributes);
if ($this->useSti()) {
$this->setAttribute($this->stiClassField, get_class($this));
}
}
示例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;
}
示例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);
}
示例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);
}
示例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'];
}
示例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();
}
示例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();
}
示例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;
});
}
}
示例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);
}