class Model

Hierarchy

  • class \Symfony\Component\Serializer\Tests\Model

Expanded class hierarchy of Model

File

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

Namespace

Symfony\Component\Serializer\Tests
View source
class Model {
  private $title;
  private $numbers;
  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;
  }
  public function getTitle() {
    return $this->title;
  }
  public function setTitle($title) {
    $this->title = $title;
  }
  public function getNumbers() {
    return $this->numbers;
  }
  public function setNumbers($numbers) {
    $this->numbers = $numbers;
  }
  public function toArray() {
    return array(
      'title' => $this->title,
      'numbers' => $this->numbers,
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Model::$numbers private property
Model::$title private property
Model::fromArray public static function
Model::getNumbers public function
Model::getTitle public function
Model::setNumbers public function
Model::setTitle public function
Model::toArray public function