* Returns the attribute names that are safe to be massively assigned in the current scenario. * @return string[] safe attribute names */
()
| 790 | * @return string[] safe attribute names |
| 791 | */ |
| 792 | public function safeAttributes() |
| 793 | { |
| 794 | $scenario = $this->getScenario(); |
| 795 | $scenarios = $this->scenarios(); |
| 796 | if (!isset($scenarios[$scenario])) { |
| 797 | return []; |
| 798 | } |
| 799 | $attributes = []; |
| 800 | foreach ($scenarios[$scenario] as $attribute) { |
| 801 | if (strncmp($attribute, '!', 1) !== 0 && !in_array('!' . $attribute, $scenarios[$scenario])) { |
| 802 | $attributes[] = $attribute; |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | return $attributes; |
| 807 | } |
| 808 | |
| 809 | /** |
| 810 | * Returns the attribute names that are subject to validation in the current scenario. |
no test coverage detected