- Minor enhancements

This commit is contained in:
Dave M. 2023-04-05 17:42:02 +00:00
parent eb6434bb72
commit cfaebbecc4
2 changed files with 7 additions and 1 deletions

View File

@ -56,7 +56,8 @@ abstract class Sql {
$this->identifier = $identifier; $this->identifier = $identifier;
} }
public function __toString() { public function __toString() : string
{
return $this->identifier; return $this->identifier;
} }
}; };

View File

@ -222,6 +222,11 @@ class EntityCollection extends \ArrayObject {
return $list; return $list;
} }
public function sum($field) : float|int
{
return array_sum($this->column($field));
}
public function unique(\Stringable|callable|string $field, bool $strict = false) : self public function unique(\Stringable|callable|string $field, bool $strict = false) : self
{ {
$list = []; $list = [];