ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 
 getAttributesForEntry (ilBiblEntryInterface $entry)
 
 createAttribute ($name, $value, $entry_id)
 
- Public Member Functions inherited from ilBiblAttributeFactoryInterface
 sortAttributes (array $attributes)
 

Protected Attributes

 $field_factory
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBiblAttributeFactory::__construct ( ilBiblFieldFactoryInterface  $field_factory)

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

References $field_factory.

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

Member Function Documentation

◆ createAttribute()

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

Implements ilBiblAttributeFactoryInterface.

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

References $name.

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  }
if($format !==null) $name
Definition: metadata.php:230
Class ilBiblAttribute.

◆ getAttributesForEntry()

ilBiblAttributeFactory::getAttributesForEntry ( ilBiblEntryInterface  $entry)

Implements ilBiblAttributeFactoryInterface.

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

References $attributes, ilBiblEntryInterface\getId(), ilBiblAttributeFactoryInterface\sortAttributes(), and ActiveRecord\where().

51  {
52  return ilBiblAttribute::where(['entry_id' => $entry->getId()])->get();
53  }
static where($where, $operator=null)
+ Here is the call graph for this function:

◆ getPossibleValuesForFieldAndObject()

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

Implements ilBiblAttributeFactoryInterface.

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

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

27  {
28  global $DIC;
29  $q = "SELECT DISTINCT(a.value) FROM il_bibl_data AS d
30 JOIN il_bibl_entry AS e ON e.data_id = d.id
31 JOIN il_bibl_attribute AS a on a.entry_id = e.id
32 WHERE 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  }
$data
Definition: storeScorm.php:23
$result
foreach($_POST as $key=> $value) $res
$DIC
Definition: xapitoken.php:46
+ 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: