| @@ 75-94 (lines=20) @@ | ||
| 72 | * @param string $property | |
| 73 | * @param mixed $value | |
| 74 | */ | |
| 75 | public function __set($property, $value) | |
| 76 |     { | |
| 77 |         switch ($property) { | |
| 78 | case '_id': | |
| 79 | $this->setId($value); | |
| 80 | break; | |
| 81 | case '_score': | |
| 82 | $this->setScore($value); | |
| 83 | break; | |
| 84 | case '_ttl': | |
| 85 | $this->setTtl($value); | |
| 86 | break; | |
| 87 | case '_parent': | |
| 88 | $this->setParent($value); | |
| 89 | break; | |
| 90 | default: | |
| 91 | // Required default case. | |
| 92 | break; | |
| 93 | } | |
| 94 | } | |
| 95 | ||
| 96 | /** | |
| 97 | * When document is cloned id is set to null. | |
| @@ 77-96 (lines=20) @@ | ||
| 74 | * @param string $property | |
| 75 | * @param mixed $value | |
| 76 | */ | |
| 77 | public function __set($property, $value) | |
| 78 |     { | |
| 79 |         switch ($property) { | |
| 80 | case '_id': | |
| 81 | $this->setId($value); | |
| 82 | break; | |
| 83 | case '_score': | |
| 84 | $this->setScore($value); | |
| 85 | break; | |
| 86 | case '_ttl': | |
| 87 | $this->setTtl($value); | |
| 88 | break; | |
| 89 | case '_parent': | |
| 90 | $this->setParent($value); | |
| 91 | break; | |
| 92 | default: | |
| 93 |                 $this->{$property} = $value; | |
| 94 | break; | |
| 95 | } | |
| 96 | } | |
| 97 | ||
| 98 | /** | |
| 99 | * Sets document unique id. | |