- Added some new method to EntityCollection (replaceWith, mergeWith, randomize, sort)

- WIP on virtual fields
- Some minor bugfixes
This commit is contained in:
Dave Mc Nicoll committed 2020-11-27 12:09:15 -05:00
1 parent c8397484e6
commit 30a0a80cbe
9 files changed
+213 -47

No files matched your search

+6 -1
View File
@@ -5,6 +5,7 @@ namespace Ulmus\Common;
use Ulmus\Annotation\Annotation,
Ulmus\Annotation\Classes\Table,
Ulmus\Annotation\Property\Field,
Ulmus\Annotation\Property\Virtual,
Ulmus\Annotation\Property\Relation;
class EntityResolver {
@@ -50,13 +51,17 @@ class EntityResolver {
return null;
}
public function fieldList($fieldKey = self::KEY_ENTITY_NAME) : array
public function fieldList($fieldKey = self::KEY_ENTITY_NAME, bool $skipVirtual = false) : array
{
$fieldList = [];
foreach($this->properties as $item) {
foreach($item['tags'] ?? [] as $tag) {
if ( $tag['object'] instanceof Field ) {
if ( $skipVirtual && ($tag['object'] instanceof Virtual )) {
break;
}
switch($fieldKey) {
case static::KEY_ENTITY_NAME:
$key = $item['name'];