protected function Foo::dbStringLoad in Coder 8.2
Loads multiple string objects.
Parameters
array $conditions: Any of the conditions used by dbStringSelect().
array $options: Any of the options used by dbStringSelect().
string $class: Class name to use for fetching returned objects.
Return value
\Drupal\locale\StringInterface[] Array of objects of the class requested.
File
- coder_sniffer/
Drupal/ Test/ good/ good.php, line 1055 - This file contains all the valid notations for the drupal coding standard.
Class
- Foo
- All classes need to have a docblock.
Code
protected function dbStringLoad(array $conditions, array $options, $class) {
$strings = array();
$result = $this
->dbStringSelect($conditions, $options)
->execute();
foreach ($result as $item) {
/** @var \Drupal\locale\StringInterface $string */
$string = new $class($item);
$string
->setStorage($this);
$strings[] = $string;
}
return $strings;
}