Address PR comment's

Fix tests
This commit is contained in:
Nicolas Le Goff
2013-05-27 18:19:44 +02:00
committed by Romain Neutron
parent 848413dead
commit b52e4ee8c0
30 changed files with 369 additions and 191 deletions

View File

@@ -14,7 +14,7 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class databox_descriptionStructure implements IteratorAggregate
class databox_descriptionStructure implements IteratorAggregate, Countable
{
/**
*
@@ -138,4 +138,13 @@ class databox_descriptionStructure implements IteratorAggregate
return $element->toArray();
}, array_values($this->elements));
}
/**
* {@inheritdoc}
*/
public function count()
{
return count($this->elements);
}
}

View File

@@ -175,7 +175,11 @@ class databox_field implements cache_cacheableInterface
$connbas = $this->get_connection();
$sql = "SELECT * FROM metadatas_structure WHERE id=:id";
$sql = "SELECT `thumbtitle`, `separator`, `dces_element`, `tbranch`,
`type`, `report`, `multi`, `required`, `readonly`, `indexable`,
`name`, `src`, `business`, `VocabularyControlType`,
`RestrictToVocabularyControl`, `sorter`
FROM metadatas_structure WHERE id=:id";
$stmt = $connbas->prepare($sql);
$stmt->execute(array(':id' => $id));
@@ -805,21 +809,21 @@ class databox_field implements cache_cacheableInterface
}
/**
*
* @return string
*/
public function get_name()
{
return $this->name;
}
/**
*
* @return string
*/
public function get_position()
{
return $this->position;
}
/**
*
* @return string
@@ -859,7 +863,7 @@ class databox_field implements cache_cacheableInterface
'readonly' => $this->readonly,
'multi' => $this->multi,
'indexable' => $this->indexable,
'dces-element' => $this->dces_element ? $this->dces_element->get_label(): null,
'dces-element' => $this->dces_element ? $this->dces_element->get_label() : null,
'vocabulary-type' => $this->Vocabulary ? $this->Vocabulary->getType() : null,
'vocabulary-restricted' => $this->VocabularyRestriction,
);