add method isType(), make functions explicitly public

This commit is contained in:
Uwe Steinmann 2019-08-07 08:10:05 +02:00
parent 61a15c877f
commit 4a7d572f95

View File

@ -47,6 +47,15 @@ class SeedDMS_Core_Object { /* {{{ */
$this->_dms = null; $this->_dms = null;
} /* }}} */ } /* }}} */
/**
* Check if this object is of a given type.
*
* This method must be implemened in the child class
*
* @param string $type type of object
*/
public function isType($type) {return false;}
/** /**
* Set dms this object belongs to. * Set dms this object belongs to.
* *
@ -57,23 +66,27 @@ class SeedDMS_Core_Object { /* {{{ */
* *
* @param SeedDMS_Core_DMS $dms reference to dms * @param SeedDMS_Core_DMS $dms reference to dms
*/ */
function setDMS($dms) { /* {{{ */ public function setDMS($dms) { /* {{{ */
$this->_dms = $dms; $this->_dms = $dms;
} /* }}} */ } /* }}} */
public function getDMS() { /* {{{ */
return $this->_dms;
} /* }}} */
/** /**
* Return the internal id of the document * Return the internal id of the document
* *
* @return integer id of document * @return integer id of document
*/ */
function getID() { return $this->_id; } public function getID() { return $this->_id; }
/** /**
* Returns all attributes set for the object * Returns all attributes set for the object
* *
* @return array|bool * @return array|bool
*/ */
function getAttributes() { /* {{{ */ public function getAttributes() { /* {{{ */
if (!$this->_attributes) { if (!$this->_attributes) {
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
@ -113,7 +126,7 @@ class SeedDMS_Core_Object { /* {{{ */
* @return array|string value of attritbute or false. The value is an array * @return array|string value of attritbute or false. The value is an array
* if the attribute is defined as multi value * if the attribute is defined as multi value
*/ */
function getAttribute($attrdef) { /* {{{ */ public function getAttribute($attrdef) { /* {{{ */
if (!$this->_attributes) { if (!$this->_attributes) {
$this->getAttributes(); $this->getAttributes();
} }
@ -133,7 +146,7 @@ class SeedDMS_Core_Object { /* {{{ */
* @return array|string value of attritbute or false. The value is an array * @return array|string value of attritbute or false. The value is an array
* if the attribute is defined as multi value * if the attribute is defined as multi value
*/ */
function getAttributeValue($attrdef) { /* {{{ */ public function getAttributeValue($attrdef) { /* {{{ */
if (!$this->_attributes) { if (!$this->_attributes) {
$this->getAttributes(); $this->getAttributes();
} }
@ -171,7 +184,7 @@ class SeedDMS_Core_Object { /* {{{ */
* @return array|bool * @return array|bool
* even if the attribute is not defined as multi value * even if the attribute is not defined as multi value
*/ */
function getAttributeValueAsArray($attrdef) { /* {{{ */ public function getAttributeValueAsArray($attrdef) { /* {{{ */
if (!$this->_attributes) { if (!$this->_attributes) {
$this->getAttributes(); $this->getAttributes();
} }
@ -194,7 +207,7 @@ class SeedDMS_Core_Object { /* {{{ */
* @return string value of attritbute or false. The value is always a string * @return string value of attritbute or false. The value is always a string
* even if the attribute is defined as multi value * even if the attribute is defined as multi value
*/ */
function getAttributeValueAsString($attrdef) { /* {{{ */ public function getAttributeValueAsString($attrdef) { /* {{{ */
if (!$this->_attributes) { if (!$this->_attributes) {
$this->getAttributes(); $this->getAttributes();
} }
@ -214,7 +227,7 @@ class SeedDMS_Core_Object { /* {{{ */
* must be an array * must be an array
* @return boolean true if operation was successful, otherwise false * @return boolean true if operation was successful, otherwise false
*/ */
function setAttributeValue($attrdef, $value) { /* {{{ */ public function setAttributeValue($attrdef, $value) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
if (!$this->_attributes) { if (!$this->_attributes) {
$this->getAttributes(); $this->getAttributes();
@ -265,7 +278,7 @@ class SeedDMS_Core_Object { /* {{{ */
* @param SeedDMS_Core_AttributeDefinition $attrdef * @param SeedDMS_Core_AttributeDefinition $attrdef
* @return boolean true if operation was successful, otherwise false * @return boolean true if operation was successful, otherwise false
*/ */
function removeAttribute($attrdef) { /* {{{ */ public function removeAttribute($attrdef) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
if (!$this->_attributes) { if (!$this->_attributes) {
$this->getAttributes(); $this->getAttributes();