Gc\Datatype\Model::fromArray PHP Method

fromArray() public static method

Get Model from array
public static fromArray ( array $array ) : Model
$array array Data
return Model
    public static function fromArray(array $array)
    {
        $datatypeTable = new Model();
        $datatypeTable->setData($array);
        $datatypeTable->setOrigData();
        return $datatypeTable;
    }

Usage Example

コード例 #1
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     $this->datatype = DatatypeModel::fromArray(array('name' => 'AbstractDatatype', 'prevalue_value' => 's:16:"AbstractDatatype";', 'model' => 'AbstractDatatype'));
     $this->datatype->save();
     $this->object = $this->getMockForAbstractClass('Gc\\Datatype\\AbstractDatatype');
     $application = Registry::get('Application');
     $this->object->setRequest($application->getServiceManager()->get('Request'));
     $this->object->setRouter($application->getServiceManager()->get('Router'));
     $this->object->setHelperManager($application->getServiceManager()->get('viewhelpermanager'));
     $this->object->load($this->datatype, 1);
 }
All Usage Examples Of Gc\Datatype\Model::fromArray