ConfigPagesStorage.php in Config Pages 8.3
File
src/ConfigPagesStorage.php
View source
<?php
namespace Drupal\config_pages;
use Drupal\config_pages\Entity\ConfigPages;
use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
class ConfigPagesStorage extends SqlContentEntityStorage {
public function load($id) {
$entity = NULL;
if (is_numeric($id)) {
$entities = parent::loadMultiple([
$id,
]);
$entity = isset($entities[$id]) ? $entities[$id] : NULL;
}
else {
$entity = ConfigPages::config($id);
}
return $entity;
}
public function loadMultiple(array $ids = NULL) {
$entities = [];
foreach ($ids as $id) {
$entity = $this
->load($id);
if (!empty($entity)) {
$entities[$entity
->id()] = $entity;
}
}
return !empty($entities) ? $entities : NULL;
}
}