uawdijnntqw1x1x1
IP : 216.73.216.119
Hostname : toronto-dev2
Kernel : Linux toronto-dev2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
srv
/
users
/
craft4
/
apps
/
craft4-newsite-space
/
vendor
/
craftcms
/
commerce
/
src
/
models
/
LineItemStatus.php
/
/
<?php /** * @link https://craftcms.com/ * @copyright Copyright (c) Pixel & Tonic, Inc. * @license https://craftcms.github.io/license/ */ namespace craft\commerce\models; use craft\commerce\base\Model; use craft\helpers\Html; use craft\helpers\UrlHelper; use DateTime; /** * Order status model. * * @property string $cpEditUrl * @property array $emailIds * @property-read array $config * @property string $labelHtml * @author Pixel & Tonic, Inc. <support@pixelandtonic.com> * @since 2.0 */ class LineItemStatus extends Model { /** * @var int|null ID */ public ?int $id = null; /** * @var string|null Name */ public ?string $name = null; /** * @var string|null Handle */ public ?string $handle = null; /** * @var string Color */ public string $color = 'green'; /** * @var int|null Sort order */ public ?int $sortOrder = null; /** * @var bool Default status */ public bool $default = false; /** * @var bool Whether the order status is archived. */ public bool $isArchived = false; /** * @var DateTime|null Archived Date */ public ?DateTime $dateArchived = null; /** * @var string|null UID */ public ?string $uid = null; /** * @return string */ public function __toString() { return (string)$this->name; } protected function defineRules(): array { return [ [['name', 'handle'], 'required'], ]; } /** * @inerhitdoc */ public function extraFields(): array { $fields = parent::extraFields(); $fields[] = 'labelHtml'; return $fields; } public function getCpEditUrl(): string { return UrlHelper::cpUrl('commerce/settings/lineitemstatuses/' . $this->id); } public function getLabelHtml(): string { return sprintf('<span class="commerceStatusLabel"><span class="status %s"></span>%s</span>', $this->color, Html::encode($this->name)); } /** * Returns the config for this status. * * @since 3.2.2 */ public function getConfig(): array { return [ 'name' => $this->name, 'handle' => $this->handle, 'color' => $this->color, 'sortOrder' => $this->sortOrder ?: 9999, 'default' => $this->default, ]; } }
/srv/users/craft4/apps/craft4-newsite-space/vendor/craftcms/commerce/src/models/LineItemStatus.php