* Returns the attribute names that are subject to validation in the current scenario. * @return string[] safe attribute names */
()
| 811 | * @return string[] safe attribute names |
| 812 | */ |
| 813 | public function activeAttributes() |
| 814 | { |
| 815 | $scenario = $this->getScenario(); |
| 816 | $scenarios = $this->scenarios(); |
| 817 | if (!isset($scenarios[$scenario])) { |
| 818 | return []; |
| 819 | } |
| 820 | $attributes = array_keys(array_flip($scenarios[$scenario])); |
| 821 | foreach ($attributes as $i => $attribute) { |
| 822 | if (strncmp($attribute, '!', 1) === 0) { |
| 823 | $attributes[$i] = substr($attribute, 1); |
| 824 | } |
| 825 | } |
| 826 | |
| 827 | return $attributes; |
| 828 | } |
| 829 | |
| 830 | /** |
| 831 | * Populates the model with input data. |
no test coverage detected