| @@ 106-115 (lines=10) @@ | ||
| 103 | // with Entity specific methods |
|
| 104 | $attributes = $this->attributesToArray($this->attributes); |
|
| 105 | ||
| 106 | foreach ($this->attributes as $key => $attribute) { |
|
| 107 | if (in_array($key, $this->hidden)) { |
|
| 108 | unset($attributes[$key]); |
|
| 109 | continue; |
|
| 110 | } |
|
| 111 | if ($this->hasGetMutator($key)) { |
|
| 112 | $method = 'get' . $this->getMutatorMethod($key); |
|
| 113 | $attributes[$key] = $this->$method($attribute); |
|
| 114 | } |
|
| 115 | } |
|
| 116 | return $attributes; |
|
| 117 | } |
|
| 118 | ||
| @@ 127-136 (lines=10) @@ | ||
| 124 | */ |
|
| 125 | public function fill(array $attributes) |
|
| 126 | { |
|
| 127 | foreach ($attributes as $key => $attribute) { |
|
| 128 | ||
| 129 | if ($this->hasSetMutator($key)) { |
|
| 130 | $method = 'set' . $this->getMutatorMethod($key); |
|
| 131 | $this->attributes[$key] = $this->$method($attribute); |
|
| 132 | } |
|
| 133 | else { |
|
| 134 | $this->attributes[$key] = $attribute; |
|
| 135 | } |
|
| 136 | } |
|
| 137 | } |
|
| 138 | } |
|
| 139 | ||