function FetchModeTrait::assocToClassType
Converts a row of data to FETCH_CLASS | FETCH_CLASSTYPE.
Parameters
array $rowAssoc: A row of data in FETCH_ASSOC format.
array $constructorArguments: Elements of this array are passed to the constructor.
Return value
object The row in FETCH_CLASS format.
Deprecated
in drupal:10.2.0 and is removed from drupal:11.0.0. Use supported modes only.
See also
https://www.drupal.org/node/3377999
File
-
core/
lib/ Drupal/ Core/ Database/ FetchModeTrait.php, line 129
Class
- FetchModeTrait
- Provide helper methods for statement fetching.
Namespace
Drupal\Core\DatabaseCode
protected function assocToClassType(array $rowAssoc, array $constructorArguments) : object {
@trigger_error(__METHOD__ . '() is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use supported modes only. See https://www.drupal.org/node/3377999', E_USER_DEPRECATED);
$className = array_shift($rowAssoc);
return $this->assocToClass($rowAssoc, $className, $constructorArguments);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.