plugin/open-badge/Serializer/EvidenceSerializer.php
public function deserialize(array $data, Evidence $evidence = null, array $options = [])
    {
        $this->sipe('narrative', 'setNarrative', $data, $evidence);
        $this->sipe('name', 'setName', $data, $evidence);

        if (isset($data['resources'])) {
            $resources = [];
            foreach ($data['resources'] as $resource) {
                $node = $this->_om->getObject($resource, ResourceNode::class);
                $resources[] = $this->resourceNodeSerializer->deserialize($resource, $node);
            }
            $evidence->setResourceEvidences($resources);
        }
    }
public function deserialize(array $data, Evidence $evidence = null, array $options = [])
    {
        $this->sipe('narrative', 'setNarrative', $data, $evidence);
        $this->sipe('name', 'setName', $data, $evidence);

        if (isset($data['resources'])) {
            $resources = [];
            foreach ($data['resources'] as $resource) {
                $node = $this->_om->getObject($resource, ResourceNode::class);
                $resources[] = $this->resourceNodeSerializer->deserialize($resource, $node);
            }
            $evidence->setResourceEvidences($resources);
        }
    }
public function deserialize ( array $ data , Evidence $ evidence = null , array $ options = [ ] ) { $ this -> sipe ( 'narrative' , 'setNarrative' , $ data , $ evidence ) ; $ this -> sipe ( 'name' , 'setName' , $ data , $ evidence ) ; if ( isset ( $ data [ 'resources' ] ) ) { $ resources = [ ] ; foreach ( $ data [ 'resources' ] as $ resource ) { $ node = $ this -> _om -> getObject ( $ resource , ResourceNode :: class ) ; $ resources [ ] = $ this -> resourceNodeSerializer -> deserialize ( $ resource , $ node ) ; } $ evidence -> setResourceEvidences ( $ resources ) ; } }
Serializes a Evidence entity.

@param array    $data
@param Evidence $evidence
@param array    $options

@return array
Serializes a Evidence entity .