ILIAS  release_7 Revision v7.30-3-g800a261c036
ilBiblAttributeFactory Class Reference

Class ilBiblAttributeFactory. More...

+ Inheritance diagram for ilBiblAttributeFactory:
+ Collaboration diagram for ilBiblAttributeFactory:

Public Member Functions

 __construct (ilBiblFieldFactoryInterface $field_factory)
 
 getPossibleValuesForFieldAndObject (ilBiblFieldInterface $field, $object_id)
 @inheritDoc More...
 
 getAttributesForEntry (ilBiblEntryInterface $entry)
 @inheritDoc More...
 
 createAttribute ($name, $value, $entry_id)
 @inheritDoc More...
 
- Public Member Functions inherited from ilBiblAttributeFactoryInterface
 getPossibleValuesForFieldAndObject (ilBiblFieldInterface $field, $object_id)
 
 getAttributesForEntry (ilBiblEntryInterface $entry)
 
 sortAttributes (array $attributes)
 
 createAttribute ($name, $value, $entry_id)
 

Protected Attributes

 $field_factory
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBiblAttributeFactory::__construct ( ilBiblFieldFactoryInterface  $field_factory)

Definition at line 17 of file class.ilBiblAttributeFactory.php.

18 {
19 $this->field_factory = $field_factory;
20 }

References $field_factory.

Member Function Documentation

◆ createAttribute()

ilBiblAttributeFactory::createAttribute (   $name,
  $value,
  $entry_id 
)

@inheritDoc

Implements ilBiblAttributeFactoryInterface.

Definition at line 88 of file class.ilBiblAttributeFactory.php.

89 {
90 $ilBiblAttribute = new ilBiblAttribute();
91 $ilBiblAttribute->setName($name);
92 $ilBiblAttribute->setValue($value);
93 $ilBiblAttribute->setEntryId($entry_id);
94 $ilBiblAttribute->store();
95
96 $this->field_factory->findOrCreateFieldOfAttribute($ilBiblAttribute);
97 }
Class ilBiblAttribute.
if($format !==null) $name
Definition: metadata.php:230

References $name.

◆ getAttributesForEntry()

ilBiblAttributeFactory::getAttributesForEntry ( ilBiblEntryInterface  $entry)

@inheritDoc

Implements ilBiblAttributeFactoryInterface.

Definition at line 50 of file class.ilBiblAttributeFactory.php.

51 {
52 return ilBiblAttribute::where(['entry_id' => $entry->getId()])->get();
53 }
static where($where, $operator=null)

References ilBiblEntryInterface\getId(), and ActiveRecord\where().

+ Here is the call graph for this function:

◆ getPossibleValuesForFieldAndObject()

ilBiblAttributeFactory::getPossibleValuesForFieldAndObject ( ilBiblFieldInterface  $field,
  $object_id 
)

@inheritDoc

Implements ilBiblAttributeFactoryInterface.

Definition at line 26 of file class.ilBiblAttributeFactory.php.

27 {
28 global $DIC;
29 $q = "SELECT DISTINCT(a.value) FROM il_bibl_data AS d
30JOIN il_bibl_entry AS e ON e.data_id = d.id
31JOIN il_bibl_attribute AS a on a.entry_id = e.id
32WHERE a.name = %s AND d.id = %s";
33
34 $res = $DIC->database()->queryF($q, ['text', 'integer'], [
35 $field->getIdentifier(),
36 $object_id,
37 ]);
38 $result = [];
39 while ($data = $DIC->database()->fetchObject($res)) {
40 $result[$data->value] = $data->value;
41 }
42
43 return $result;
44 }
$result
global $DIC
Definition: goto.php:24
foreach($_POST as $key=> $value) $res
$data
Definition: storeScorm.php:23

References $data, $DIC, $res, $result, and ilBiblFieldInterface\getIdentifier().

+ Here is the call graph for this function:

Field Documentation

◆ $field_factory

ilBiblAttributeFactory::$field_factory
protected

Definition at line 14 of file class.ilBiblAttributeFactory.php.

Referenced by __construct().


The documentation for this class was generated from the following file: