Gc\Document\Model::fromArray PHP Méthode

fromArray() public static méthode

Initialize document from array
public static fromArray ( array $array ) : Model
$array array Data
Résultat Model
    public static function fromArray(array $array)
    {
        $documentTable = new Model();
        $documentTable->setData($array);
        $documentTable->setOrigData();
        return $documentTable;
    }

Usage Example

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     $serviceManager = Registry::get('Application')->getServiceManager();
     $renderer = $serviceManager->get('Zend\\View\\Renderer\\PhpRenderer');
     $serviceManager->setAllowOverride(true);
     $serviceManager->setService('currentDocument', Model::fromArray(array('id' => 1)));
     $serviceManager->setAllowOverride(false);
     $this->object = new CurrentDocument($serviceManager);
 }
All Usage Examples Of Gc\Document\Model::fromArray