- Introduce `REVENUE` as a new goal criteria type in `goals_criteria_type` enum. - Add `goals_label_t` trait for handling label properties in goal criteria. - Extend `goals_criteria` to support labels, including serialization and input validation.
32 lines
516 B
PHP
32 lines
516 B
PHP
<?php
|
|
|
|
namespace goals\traits;
|
|
|
|
trait goals_label_t
|
|
{
|
|
/**
|
|
* Human-friendly label/name for the goal criteria
|
|
* @var string|null
|
|
*/
|
|
public ?string $label = null;
|
|
|
|
/**
|
|
* Set the label
|
|
* @param string|null $label
|
|
* @return void
|
|
*/
|
|
public function setLabel(?string $label): void
|
|
{
|
|
$this->label = $label;
|
|
}
|
|
|
|
/**
|
|
* Get the label
|
|
* @return string|null
|
|
*/
|
|
public function getLabel(): ?string
|
|
{
|
|
return $this->label;
|
|
}
|
|
}
|