19 declare(strict_types=1);
46 return $this->
buildResult($rid, $revision, $definition,
false)->numRows() > 0;
55 self::F_RESOURCE_ID => [
'text', $flavour->
getResourceId()->serialize()],
56 self::F_REVISION => [
'integer', $flavour->
getRevision()],
57 self::F_DEFINITION => [
'text', $flavour->
getDefinition()->getId()],
58 self::F_VARIANT => [
'text', $flavour->
getDefinition()->getVariantName() ??
'']
74 public function delete(
Flavour $flavour):
void 76 $rid = $flavour->getResourceId();
77 $definition = $flavour->getDefinition();
79 $r = $this->db->manipulateF(
80 "DELETE FROM " . self::TABLE_NAME
81 .
" WHERE " . self::F_RESOURCE_ID .
" = %s AND " 82 . self::F_REVISION .
" = %s AND " 83 . self::F_DEFINITION .
" = %s AND (" . self::F_VARIANT .
" = %s OR " . self::F_VARIANT .
" IS NULL)",
84 [
'text',
'integer',
'text',
'text'],
85 [$rid->
serialize(), $flavour->getRevision(), $definition->getId(), $definition->getVariantName()]
90 public function preload(array $identification_strings): void
105 bool $use_cache =
true 108 if ($use_cache && isset($this->results_cache[$rcache])) {
109 return $this->results_cache[$rcache];
112 $r = $this->db->queryF(
113 "SELECT * FROM " . self::TABLE_NAME
114 .
" WHERE " . self::F_RESOURCE_ID .
" = %s AND " 115 . self::F_REVISION .
" = %s AND " 116 . self::F_DEFINITION .
" = %s AND (" . self::F_VARIANT .
" = %s OR " . self::F_VARIANT .
" IS NULL)",
126 $definition->
getId(),
130 return $this->results_cache[$rcache] =
$r;
preload(array $identification_strings)
getVariantName()
If a definition can be used in several variants (e.g.
buildResult(ResourceIdentification $rid, int $revision, FlavourDefinition $definition, bool $use_cache=true)
__construct(private \ilDBInterface $db)
has(ResourceIdentification $rid, int $revision, FlavourDefinition $definition)
Class ResourceIdentification.
populateFromArray(array $data)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...