You are here

public static function Model::fromArray in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/serializer/Tests/SerializerTest.php \Symfony\Component\Serializer\Tests\Model::fromArray()
2 calls to Model::fromArray()
SerializerTest::testSerialize in vendor/symfony/serializer/Tests/SerializerTest.php
SerializerTest::testSerializeNoNormalizer in vendor/symfony/serializer/Tests/SerializerTest.php
@expectedException \Symfony\Component\Serializer\Exception\LogicException

File

vendor/symfony/serializer/Tests/SerializerTest.php, line 230

Class

Model

Namespace

Symfony\Component\Serializer\Tests

Code

public static function fromArray($array) {
  $model = new self();
  if (isset($array['title'])) {
    $model
      ->setTitle($array['title']);
  }
  if (isset($array['numbers'])) {
    $model
      ->setNumbers($array['numbers']);
  }
  return $model;
}