ZF\Apigility\Admin\Model\ModuleEntity::getArrayCopy PHP Method

getArrayCopy() public method

Retrieve array representation
public getArrayCopy ( ) : array
return array
    public function getArrayCopy()
    {
        return ['name' => $this->name, 'namespace' => $this->namespace, 'is_vendor' => $this->isVendor(), 'rest' => $this->getRestServices(), 'rpc' => $this->getRpcServices(), 'versions' => $this->versions, 'default_version' => $this->defaultVersion];
    }

Usage Example

 /**
  * Inject relational links into a Module resource
  *
  * @param Model\ModuleEntity $resource
  * @param \Zend\Mvc\MvcEvent $e
  */
 public function injectModuleCollectionRelationalLinks(Model\ModuleEntity $resource, $e)
 {
     $asArray = $resource->getArrayCopy();
     $module = $asArray['name'];
     $rest = $asArray['rest'];
     $rpc = $asArray['rpc'];
     unset($asArray['rest']);
     unset($asArray['rpc']);
     $halEntity = new Entity($asArray, $module);
     $links = $halEntity->getLinks();
     $links->add(Link::factory(array('rel' => 'self', 'route' => array('name' => 'zf-apigility/api/module', 'params' => array('name' => $module)))));
     $this->injectLinksForServicesByType('authorization', array(), $links, $module);
     $this->injectLinksForServicesByType('rest', $rest, $links, $module);
     $this->injectLinksForServicesByType('rpc', $rpc, $links, $module);
     $e->setParam('entity', $halEntity);
 }
All Usage Examples Of ZF\Apigility\Admin\Model\ModuleEntity::getArrayCopy