Compare commits
No commits in common. "47953a6165f14c342b04aed586773b7ded705bac" and "139504f8dde7d6807fa31a474374908beb0df374" have entirely different histories.
47953a6165
...
139504f8dd
@ -4,8 +4,11 @@ namespace Ulmus\Entity\Field;
|
|||||||
|
|
||||||
class Date extends Datetime {
|
class Date extends Datetime {
|
||||||
|
|
||||||
public string $format = "Y-m-d";
|
public function __toString()
|
||||||
|
{
|
||||||
|
return $this->format("Y-m-d");
|
||||||
|
}
|
||||||
|
|
||||||
public function formatLocale(string $format) : string
|
public function formatLocale(string $format) : string
|
||||||
{
|
{
|
||||||
return strftime($format, $this->getTimestamp());
|
return strftime($format, $this->getTimestamp());
|
||||||
|
@ -4,6 +4,9 @@ namespace Ulmus\Entity\Field;
|
|||||||
|
|
||||||
class Time extends Datetime {
|
class Time extends Datetime {
|
||||||
|
|
||||||
public string $format = "H:i:s";
|
public function __toString()
|
||||||
|
{
|
||||||
|
return $this->format("H:i:s");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -122,17 +122,6 @@ class EntityCollection extends \ArrayObject {
|
|||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function implode(string $glue, ? Callable $callback = null) : string
|
|
||||||
{
|
|
||||||
$values = [];
|
|
||||||
|
|
||||||
foreach($this as $item) {
|
|
||||||
$values[] = $callback ? $callback($item) : (string) $item;
|
|
||||||
}
|
|
||||||
|
|
||||||
return implode($glue, $values);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function toArray(bool $includeRelations = false) : array {
|
public function toArray(bool $includeRelations = false) : array {
|
||||||
$list = [];
|
$list = [];
|
||||||
|
|
||||||
@ -142,7 +131,7 @@ class EntityCollection extends \ArrayObject {
|
|||||||
|
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fromArray(array $datasets, ? string $entityClass = null) : self
|
public function fromArray(array $datasets, ? string $entityClass = null) : self
|
||||||
{
|
{
|
||||||
if ( ! ($this->entityClass || $entityClass) ) {
|
if ( ! ($this->entityClass || $entityClass) ) {
|
||||||
|
@ -110,10 +110,6 @@ trait EntityTrait {
|
|||||||
$bridgeRelation = $bridgeEntity->searchFieldAnnotation($relation->field, new Relation() );
|
$bridgeRelation = $bridgeEntity->searchFieldAnnotation($relation->field, new Relation() );
|
||||||
$relationRelation = $bridgeEntity->searchFieldAnnotation($relation->foreignField, new Relation() );
|
$relationRelation = $bridgeEntity->searchFieldAnnotation($relation->foreignField, new Relation() );
|
||||||
|
|
||||||
if ($relationRelation === null) {
|
|
||||||
throw new \Exception("@Relation annotation not found for field `{$relation->foreignField}` in entity {$relation->bridge}");
|
|
||||||
}
|
|
||||||
|
|
||||||
$repository = $relationRelation->entity()->repository();
|
$repository = $relationRelation->entity()->repository();
|
||||||
|
|
||||||
$bridgeAlias = uniqid("bridge_");
|
$bridgeAlias = uniqid("bridge_");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user