public static function Model::fromArray

2 calls to Model::fromArray()
SerializerTest::testSerialize in drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/SerializerTest.php
SerializerTest::testSerializeNoNormalizer in drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/SerializerTest.php
@expectedException \Symfony\Component\Serializer\Exception\LogicException

File

drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/SerializerTest.php, line 210

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;
}