public function serialize(ResourceType $resourceType)
    {
        return [
            'id' => $resourceType->getId(),
            'name' => $resourceType->getName(),
            'class' => $resourceType->getClass(),
            'tags' => $resourceType->getTags(),
            'enabled' => $resourceType->isEnabled(),
            'actions' => array_map(function (MenuAction $resourceAction) {
                return [
                    'name' => $resourceAction->getName(),
                    'group' => $resourceAction->getGroup(),
                    'scope' => $resourceAction->getScope(),
                    'permission' => $resourceAction->getDecoder(),
                    'default' => $resourceAction->isDefault(),
                ];
            }, $this->actionManager->all($resourceType)),
        ];
    }
public function serialize(ResourceType $resourceType)
    {
        return [
            'id' => $resourceType->getId(),
            'name' => $resourceType->getName(),
            'class' => $resourceType->getClass(),
            'tags' => $resourceType->getTags(),
            'enabled' => $resourceType->isEnabled(),
            'actions' => array_map(function (MenuAction $resourceAction) {
                return [
                    'name' => $resourceAction->getName(),
                    'group' => $resourceAction->getGroup(),
                    'scope' => $resourceAction->getScope(),
                    'permission' => $resourceAction->getDecoder(),
                    'default' => $resourceAction->isDefault(),
                ];
            }, $this->actionManager->all($resourceType)),
        ];
    }
public function serialize ( ResourceType $ resourceType ) { return [ 'id' => $ resourceType -> getId ( ) , 'name' => $ resourceType -> getName ( ) , 'class' => $ resourceType -> getClass ( ) , 'tags' => $ resourceType -> getTags ( ) , 'enabled' => $ resourceType -> isEnabled ( ) , 'actions' => array_map ( function ( MenuAction $ resourceAction ) { return [ 'name' => $ resourceAction -> getName ( ) , 'group' => $ resourceAction -> getGroup ( ) , 'scope' => $ resourceAction -> getScope ( ) , 'permission' => $ resourceAction -> getDecoder ( ) , 'default' => $ resourceAction -> isDefault ( ) , ] ; } , $ this -> actionManager -> all ( $ resourceType ) ) , ] ; }
Serializes a ResourceType entity for the JSON api.

@param ResourceType $resourceType - the resource type to serialize

@return array - the serialized representation of the resource type
Serializes a ResourceType entity for the JSON api .