public function __construct() { $table = new DBTable(); $table->column('id')->integer()->primary()->increment(); $table->column('name')->string(255); parent::__construct(); }
public function save() { // We have overwritten the save method, so we call the parent save to ensure that the // data is saved. We want this to happen before be save the meta-data so we can use $this->id; parent::save(); $this->saveMetaData(); }
public function __construct($fileId = null, $key = null, $value = null) { parent::__construct(); $this->file_id = $fileId; $this->key = $key; $this->value = $value; }
public function __construct($userId = null, $key = null, $value = null) { parent::__construct(); $this->columns = array_merge($this->columns, [static::USER_IDENTIFIER_KEY]); $this->user_id = $userId; $this->key = $key; $this->value = $value; }
public function delete() { // Delete psychical file if (file_exists($this->getLocalFile())) { unlink($this->getLocalFile()); } parent::delete(); }
public function __construct() { $table = new DBTable('source_cloudflare'); $table->column('id')->bigint()->primary()->increment(); $table->column('source_id')->integer()->index(); $table->column('cloudflare_identifier')->string(36)->index(); parent::__construct($table); }
public function save() { $exists = self::scalar('SELECT `user_id` FROM {table} WHERE `user_id` = %s && `organisation_id` = %s', $this->user_id, $this->organisation_id); if (!$exists) { return parent::save(); } return null; }
public function __construct() { $table = new DBTable(); $table->column('id')->integer()->primary()->increment(); $table->column('company_id')->integer()->index(); $table->column('key')->string(255)->index(); $table->column('value')->longtext(); parent::__construct($table); }
public function __construct() { $table = new DBTable(); $table->column('id')->integer()->primary()->increment(); $table->column('source_id')->bigint()->index(); $table->column('key')->string()->index(); $table->column('value')->text()->nullable(); parent::__construct($table); }
public function __construct() { $table = new DBTable(); $table->column('id')->bigint()->primary()->increment(); $table->column('user_id')->bigint()->index(); $table->column('email')->string(255)->index(); $table->column('organisation_id')->bigint()->index(); $table->column('role')->string(255); $table->column('created')->datetime()->index(); parent::__construct($table); $this->created = Date::toDateTime(); }
public function __construct() { $table = new DBTable(); $table->column('name')->string(255)->primary(); $table->column('path')->string(40)->index(); $table->column('host')->string(50)->index(); $table->column('capacity_free_gb')->integer(); $table->column('capacity_max_gb')->integer(); $table->column('capacity_limit')->integer(); $table->column('active')->bool()->index(); parent::__construct($table); $this->active = true; }
public function __construct() { $table = new DBTable(); $table->column('id')->bigint()->primary()->increment(); $table->column('organisation_id')->bigint()->index(); $table->column('amount')->float()->index(); $table->column('currency')->string(40)->nullable(); $table->column('transaction_id')->string()->nullable()->index(); $table->column('period_start')->date()->index(); $table->column('period_end')->date()->index(); $table->column('payment_date')->datetime()->index(); parent::__construct($table); $this->amount = 0; $this->payment_date = Date::toDateTime(); }
public function __construct() { $table = new DBTable(); $table->column('id')->bigint()->primary()->increment(); $table->column('user_id')->bigint()->index(); $table->column('organisation_id')->bigint()->index(); $table->column('invoice_id')->integer()->index(); $table->column('path')->string(300); $table->column('due_date')->date()->index(); $table->column('amount_total')->integer()->index(); $table->column('payed')->bool()->index(); $table->column('created')->datetime()->index(); parent::__construct($table); if (ModelUser::current()->isLoggedIn()) { $this->user_id = ModelUser::current()->id; } $this->created = Date::toDateTime(); }
public function __construct() { $table = new DBTable(); $table->column('id')->bigint()->primary()->increment(); $table->column('name')->string(255)->index(); $table->column('api_token')->string(40)->index(); $table->column('stripe_identifier_id')->string(40)->nullable(); $table->column('discount_percentage')->float()->nullable(); $table->column('free_amount')->float()->nullable(); $table->column('fixed_plan_amount')->float()->nullable(); $table->column('included_master_images')->integer()->nullable(); $table->column('included_bandwidth_mb')->integer()->nullable(); $table->column('disabled')->bool()->index(); $table->column('deleted')->bool()->index(); parent::__construct($table); $this->api_token = Guid::create(); $this->free_amount = 10; $this->disabled = false; $this->deleted = false; }
public function __construct() { $table = new DBTable('activity'); $table->column('id')->bigint()->increment()->primary(); $table->column('source_id')->bigint()->index(); $table->column('thumbnail_id')->bigint()->nullable()->index(); $table->column('path')->string(400); $table->column('method')->string(30); $table->column('agent')->string()->nullable(); $table->column('referer')->string()->nullable(); $table->column('ip')->string()->index(); /** * NOTE: identifier is the file's unique id - based on the "path" column. * It is used as a faster way to determinate if a path has been accessed multiple times, * when calculating statistics - and might speed up things when inserting instead of * creating an index to the path column. **/ $table->column('identifier')->string(36)->index(); $table->column('filesize')->integer()->nullable()->index(); $table->column('master')->bool()->index(); $table->column('created')->datetime()->index(); parent::__construct($table); $this->created = Date::toDateTime(); }
public function __construct() { parent::__construct(); $this->ip = request()->getIp(); $this->active = true; }
public function subQuery(Model $model, $alias = null) { return $this->query->subQuery($model->getQuery(), $alias); }
public function toArray() { $output = parent::toArray(); if (is_array($output)) { return array_merge($this->data->getData(), $output); } return $output; }
public function save(array $data = null) { $this->clean(); parent::save($data); }
public function __construct() { parent::__construct(); $this->ip = request()->ip; }