Gc\Property\Model::fromArray PHP Method

fromArray() public static method

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

Usage Example

Example #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testFromArray()
 {
     $model = Model::fromArray(array('name' => 'DatatypeTest', 'identifier' => 'DatatypeTest', 'description' => 'DatatypeTest', 'required' => false, 'sort_order' => 1, 'tab_id' => $this->tab->getId(), 'datatype_id' => $this->datatype->getId()));
     $this->assertInstanceOf('Gc\\Property\\Model', $model);
 }
All Usage Examples Of Gc\Property\Model::fromArray