Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/RelationController.php
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | class RelationController extends ResourceController | ||||
* @param bool $full Include all object properties | * @param bool $full Include all object properties | ||||
* | * | ||||
* @return array Object information | * @return array Object information | ||||
*/ | */ | ||||
protected function objectToClient($object, bool $full = false): array | protected function objectToClient($object, bool $full = false): array | ||||
{ | { | ||||
if ($full) { | if ($full) { | ||||
$result = $object->toArray(); | $result = $object->toArray(); | ||||
unset($result['tenant_id']); | |||||
} else { | } else { | ||||
$result = ['id' => $object->id]; | $result = ['id' => $object->id]; | ||||
foreach ($this->objectProps as $prop) { | foreach ($this->objectProps as $prop) { | ||||
$result[$prop] = $object->{$prop}; | $result[$prop] = $object->{$prop}; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines |