- Add `goals_criteria` base class implementing customizable goal criteria. - Introduce interfaces and traits for modular handling of users, departments, and products in goal criteria. - Include enumeration for goal types (`goals_criteria_type`). - Implement timeframe and target management through traits. - Provide initial configuration for enabling the goals module.
31 lines
512 B
PHP
31 lines
512 B
PHP
<?php
|
|
|
|
namespace goals\traits;
|
|
|
|
trait goals_target_t
|
|
{
|
|
/**
|
|
* Target (Goal target value)
|
|
* @var float $target
|
|
*/
|
|
public float $target = 0.0;
|
|
|
|
/**
|
|
* Set the target value
|
|
* @param float|int $value
|
|
* @return void
|
|
*/
|
|
public function setTarget(float|int $value): void
|
|
{
|
|
$this->target = (float)$value;
|
|
}
|
|
|
|
/**
|
|
* Get the target value
|
|
* @return float
|
|
*/
|
|
public function getTarget(): float
|
|
{
|
|
return $this->target;
|
|
}
|
|
} |