Add orderable flat to subdef

This commit is contained in:
Benoît Burnichon
2016-02-10 16:52:14 +01:00
parent 5f4cfae0ca
commit 20178f76cd
2 changed files with 59 additions and 2 deletions

View File

@@ -59,6 +59,11 @@ class databox_subdef
*/
private $requiresMetadataUpdate;
/**
* @var bool
*/
private $orderable;
/**
* @param SubdefType $type
* @param SimpleXMLElement $sd
@@ -76,6 +81,7 @@ class databox_subdef
$this->name = strtolower($sd->attributes()->name);
$this->downloadable = p4field::isyes($sd->attributes()->downloadable);
$this->orderable = isset($sd->attributes()->orderable) ? p4field::isyes($sd->attributes()->orderable) : true;
$this->path = trim($sd->path) !== '' ? p4string::addEndSlash(trim($sd->path)) : '';
$this->requiresMetadataUpdate = p4field::isyes((string) $sd->meta);
@@ -314,6 +320,14 @@ class databox_subdef
return $this->downloadable;
}
/**
* @return bool
*/
public function isOrderable()
{
return $this->orderable;
}
/**
* Get an array of Alchemy\Phrasea\Media\Subdef\Subdef available for the current Media Type
*