plugin/reservation/Serializer/ResourceRightsSerializer.php
public function deserialize($data, ResourceRights $resourceRights = null)
    {
        if (empty($resourceRights)) {
            $resourceRights = new ResourceRights();
        }
        if (isset($data['mask'])) {
            $resourceRights->setMask($data['mask']);
        }
        if (isset($data['resource'])) {
            $resource = $this->resourceRepo->findOneBy(['uuid' => $data['resource']['id']]);
            $resourceRights->setResource($resource);
        }
        if (isset($data['role'])) {
            $role = $this->roleRepo->findOneBy(['uuid' => $data['role']['id']]);
            $resourceRights->setRole($role);
        }

        return $resourceRights;
    }
public function deserialize($data, ResourceRights $resourceRights = null)
    {
        if (empty($resourceRights)) {
            $resourceRights = new ResourceRights();
        }
        if (isset($data['mask'])) {
            $resourceRights->setMask($data['mask']);
        }
        if (isset($data['resource'])) {
            $resource = $this->resourceRepo->findOneBy(['uuid' => $data['resource']['id']]);
            $resourceRights->setResource($resource);
        }
        if (isset($data['role'])) {
            $role = $this->roleRepo->findOneBy(['uuid' => $data['role']['id']]);
            $resourceRights->setRole($role);
        }

        return $resourceRights;
    }
public function deserialize ( $ data , ResourceRights $ resourceRights = null ) { if ( empty ( $ resourceRights ) ) { $ resourceRights = new ResourceRights ( ) ; } if ( isset ( $ data [ 'mask' ] ) ) { $ resourceRights -> setMask ( $ data [ 'mask' ] ) ; } if ( isset ( $ data [ 'resource' ] ) ) { $ resource = $ this -> resourceRepo -> findOneBy ( [ 'uuid' => $ data [ 'resource' ] [ 'id' ] ] ) ; $ resourceRights -> setResource ( $ resource ) ; } if ( isset ( $ data [ 'role' ] ) ) { $ role = $ this -> roleRepo -> findOneBy ( [ 'uuid' => $ data [ 'role' ] [ 'id' ] ] ) ; $ resourceRights -> setRole ( $ role ) ; } return $ resourceRights ; }
Deserializes data into a ResourceRights entity.

@param \stdClass      $data
@param ResourceRights $resourceRights

@return ResourceRights
Deserializes data into a ResourceRights entity .