src/Gzero/Api/Transformer/ContentTransformer.php
public function transform($content)
    {
        $content = $this->entityToArray(Content::class, $content);
        return [
            'id'               => $this->setNullableValue($content['id']),
            'parentId'         => $this->setNullableValue($content['parent_id']),
            'type'             => $content['type'],
            'theme'            => $content['theme'],
            'weight'           => (int) $content['weight'],
            'rating'           => (int) $content['rating'],
            'visits'           => (int) $content['visits'],
            'isActive'         => (bool) $content['is_active'],
            'isOnHome'         => (bool) $content['is_on_home'],
            'isCommentAllowed' => (bool) $content['is_comment_allowed'],
            'isPromoted'       => (bool) $content['is_promoted'],
            'isSticky'         => (bool) $content['is_sticky'],
            'path'             => $this->buildPath($content['path']),
            'publishedAt'      => $content['published_at'],
            'createdAt'        => $content['created_at'],
            'updatedAt'        => $content['updated_at']
        ];
    }
public function transform($content)
    {
        $content = $this->entityToArray(Content::class, $content);
        return [
            'id'               => $this->setNullableValue($content['id']),
            'parentId'         => $this->setNullableValue($content['parent_id']),
            'type'             => $content['type'],
            'theme'            => $content['theme'],
            'weight'           => (int) $content['weight'],
            'rating'           => (int) $content['rating'],
            'visits'           => (int) $content['visits'],
            'isActive'         => (bool) $content['is_active'],
            'isOnHome'         => (bool) $content['is_on_home'],
            'isCommentAllowed' => (bool) $content['is_comment_allowed'],
            'isPromoted'       => (bool) $content['is_promoted'],
            'isSticky'         => (bool) $content['is_sticky'],
            'path'             => $this->buildPath($content['path']),
            'publishedAt'      => $content['published_at'],
            'createdAt'        => $content['created_at'],
            'updatedAt'        => $content['updated_at']
        ];
    }
public function transform ( $ content ) { $ content = $ this -> entityToArray ( Content :: class , $ content ) ; return [ 'id' => $ this -> setNullableValue ( $ content [ 'id' ] ) , 'parentId' => $ this -> setNullableValue ( $ content [ 'parent_id' ] ) , 'type' => $ content [ 'type' ] , 'theme' => $ content [ 'theme' ] , 'weight' => ( int ) $ content [ 'weight' ] , 'rating' => ( int ) $ content [ 'rating' ] , 'visits' => ( int ) $ content [ 'visits' ] , 'isActive' => ( bool ) $ content [ 'is_active' ] , 'isOnHome' => ( bool ) $ content [ 'is_on_home' ] , 'isCommentAllowed' => ( bool ) $ content [ 'is_comment_allowed' ] , 'isPromoted' => ( bool ) $ content [ 'is_promoted' ] , 'isSticky' => ( bool ) $ content [ 'is_sticky' ] , 'path' => $ this -> buildPath ( $ content [ 'path' ] ) , 'publishedAt' => $ content [ 'published_at' ] , 'createdAt' => $ content [ 'created_at' ] , 'updatedAt' => $ content [ 'updated_at' ] ] ; }
Transforms content entity

@param Content|array $content Content entity

@return array
Transforms content entity