| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace ThurData\Servers\KerioEmail\Core\Models\Whmcs;
- use \Illuminate\Database\Eloquent\Model as EloquentModel;
- /**
- * Description of CustomField
- *
- * @var id
- * @var type
- * @var relid
- * @var fieldname
- * @var fieldtype
- * @var description
- * @var fieldoptions
- * @var regexpr
- * @var adminonly
- * @var required
- * @var showorder
- * @var showinvoice
- * @var sortorder
- * @var created_at
- * @var updated_at
- *
- * @autor ThurData <info@thurdata.ch>
- */
- class CustomField extends EloquentModel
- {
- /**
- * Table name
- *
- * @var string
- */
- protected $table = 'tblcustomfields';
- protected $primaryKey = 'id';
-
- /**
- * Eloquent guarded parameters
- * @var array
- */
- protected $guarded = ['id'];
- /**
- * Eloquent fillable parameters
- * @var array
- */
- protected $fillable = ['type', 'relid', 'fieldname', 'fieldtype', 'description', 'fieldoptions', 'regexpr', 'adminonly', 'required', 'showorder', 'showinvoice', 'sortorder'];
- /**
- * Indicates if the model should soft delete.
- *
- * @var bool
- */
- protected $softDelete = false;
- /**
- * Indicates if the model should be timestamped.
- *
- * @var bool
- */
- public $timestamps = true;
-
-
- public function __construct(array $attributes = [])
- {
- parent::__construct($attributes);
- }
- public function getValueByRelid($relid)
- {
- $field = new CustomFieldValue();
- $result = $field->where("fieldid", $this->attributes["id"])->where("relid", $relid)->first();
- return $result->value;
- }
- }
|