MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / getAttributes

Method getAttributes

benches/fixtures/yii/Model.php:712–726  ·  view source on GitHub ↗

* Returns attribute values. * @param array $names list of attributes whose value needs to be returned. * Defaults to null, meaning all attributes listed in [[attributes()]] will be returned. * If it is an array, only the attributes in the array will be returned. * @param array $except list of attributes whose value should NOT be returned. * @return array attribute values (

($names = null, $except = [])

Source from the content-addressed store, hash-verified

710 * @return array attribute values (name => value).
711 */
712 public function getAttributes($names = null, $except = [])
713 {
714 $values = [];
715 if ($names === null) {
716 $names = $this->attributes();
717 }
718 foreach ($names as $name) {
719 $values[$name] = $this->$name;
720 }
721 foreach ($except as $name) {
722 unset($values[$name]);
723 }
724
725 return $values;
726 }
727
728 /**
729 * Sets the attribute values in a massive way.

Callers 3

getIteratorMethod · 0.95
resolveTypeMethod · 0.80
assertions.phpFile · 0.80

Calls 1

attributesMethod · 0.95

Tested by

no test coverage detected