mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
PHRAS-2815_generate-cterms-multi-db_4.1
fix : the "generate cterms" setting is applied by db how : the "global_structure" (fields merged) now also contains field settings by db
This commit is contained in:
@@ -14,6 +14,12 @@ final class GlobalStructure implements Structure
|
||||
*/
|
||||
private $fields = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var Field[][]
|
||||
*/
|
||||
private $fieldsByDatabox = [];
|
||||
|
||||
/**
|
||||
* @var Field[]
|
||||
* */
|
||||
@@ -119,6 +125,10 @@ final class GlobalStructure implements Structure
|
||||
|
||||
public function add(Field $field)
|
||||
{
|
||||
// store info for each field, not still merged by databox
|
||||
$this->fieldsByDatabox[$field->get_databox_id()][$field->getName()] = $field;
|
||||
|
||||
// store merged infos (same field name)
|
||||
$name = $field->getName();
|
||||
|
||||
if (isset($this->fields[$name])) {
|
||||
@@ -152,6 +162,11 @@ final class GlobalStructure implements Structure
|
||||
return $this->fields;
|
||||
}
|
||||
|
||||
public function getAllFieldsByDatabox($databox_id)
|
||||
{
|
||||
return $this->fieldsByDatabox[$databox_id];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Field[]
|
||||
*/
|
||||
|
Reference in New Issue
Block a user