src/Api/Entity.php
public function toApiArray()
    {
        $entity = $this->toArray();
        foreach ($entity as $name => &$value) {
            if (null === $value) {
                unset($entity[$name]);
            } elseif ($value instanceof Entity) {
                $value = $value->toArray();
            }
        }
        return $entity;
    }
public function toApiArray()
    {
        $entity = $this->toArray();
        foreach ($entity as $name => &$value) {
            if (null === $value) {
                unset($entity[$name]);
            } elseif ($value instanceof Entity) {
                $value = $value->toArray();
            }
        }
        return $entity;
    }
public function toApiArray ( ) { $ entity = $ this -> toArray ( ) ; foreach ( $ entity as $ name => & $ value ) { if ( null === $ value ) { unset ( $ entity [ $ name ] ) ; } elseif ( $ value instanceof Entity ) { $ value = $ value -> toArray ( ) ; } } return $ entity ; }
Build multi-level array for api call`s, filter or upgrade properties

@return array
Build multi - level array for api call s filter or upgrade properties