Commit 4e00c6636e5c96a05e4cb4d9fef865a785be6a41

Authored by Paul Barrett
1 parent 1faa0263

Update to classes for CMIS enum types

Story ID:2295472. Update KT CMIS implementation to 1.0 lib/api/compliance

Committed by: Paul Barrett
lib/api/ktcmis/classes/Enum.inc.php
... ... @@ -9,15 +9,19 @@
9 9 abstract class Enum {
10 10  
11 11 // actual implementation of these will be in child classes
12   - static private $values;
13   - static private $value;
14   - static private $name;
  12 + static protected $name;
  13 + static protected $values;
  14 + static protected $value;
15 15  
16 16 /**
17 17 * Sets the value of the enumerator
18 18 *
19 19 * @param unknown_type $value
20 20 * @throws invalidArgumentException if the given value does not match one of the allowed values
  21 + *
  22 + * Extending classes may override this function to add their own additional rules for how an enum may be set,
  23 + * but they should always call this parent function afterward to invoke the base rule that the value must be
  24 + * one of the defined values
21 25 */
22 26 static protected function set($value)
23 27 {
... ... @@ -31,6 +35,7 @@ abstract class Enum {
31 35 /**
32 36 * Returns the currently set value, or null if unset
33 37 *
  38 + * @return $value the currently set value
34 39 */
35 40 static protected function get()
36 41 {
... ...
lib/api/ktcmis/enums/EnumCapabilityACL.inc.php
... ... @@ -11,8 +11,21 @@ require_once(CMIS_DIR . '/classes/Enum.inc.php');
11 11  
12 12 class EnumCapabilityACL extends Enum {
13 13  
14   - static private $values = array('none', 'discover', 'manage');
15   - static private $name = 'capabilityACL';
  14 + static protected $name = 'capabilityACL';
  15 + static protected $values = array('none', 'discover', 'manage');
  16 +
  17 + /**
  18 + * Sets the value of the enumerator
  19 + *
  20 + * @param unknown_type $value
  21 + * @throws invalidArgumentException if the given value does not match one of the allowed values
  22 + * (exception is thrown in parent class function)
  23 + */
  24 + static protected function set($value)
  25 + {
  26 + parent::set($value);
  27 + }
  28 +
16 29 }
17 30  
18 31 ?>
19 32 \ No newline at end of file
... ...
lib/api/ktcmis/enums/EnumCapabilityChanges.inc.php
... ... @@ -11,8 +11,21 @@ require_once(CMIS_DIR . '/classes/Enum.inc.php');
11 11  
12 12 class EnumCapabilityChanges extends Enum {
13 13  
14   - static private $values = array('none', 'objectidsonly', 'properties', 'all');
15   - static private $name = 'capabilityChanges';
  14 + static protected $name = 'capabilityChanges';
  15 + static protected $values = array('none', 'objectidsonly', 'properties', 'all');
  16 +
  17 + /**
  18 + * Sets the value of the enumerator
  19 + *
  20 + * @param unknown_type $value
  21 + * @throws invalidArgumentException if the given value does not match one of the allowed values
  22 + * (exception is thrown in parent class function)
  23 + */
  24 + static protected function set($value)
  25 + {
  26 + parent::set($value);
  27 + }
  28 +
16 29 }
17 30  
18 31 ?>
19 32 \ No newline at end of file
... ...
lib/api/ktcmis/enums/EnumCapabilityContentStreamUpdatability.inc.php
... ... @@ -11,8 +11,21 @@ require_once(CMIS_DIR . '/classes/Enum.inc.php');
11 11  
12 12 class EnumCapabilityContentStreamUpdatability extends Enum {
13 13  
14   - static private $values = array('none', 'anytime', 'pwconly');
15   - static private $name = 'capabilityContentStreamUpdatability';
  14 + static protected $name = 'capabilityContentStreamUpdatability';
  15 + static protected $values = array('none', 'anytime', 'pwconly');
  16 +
  17 + /**
  18 + * Sets the value of the enumerator
  19 + *
  20 + * @param unknown_type $value
  21 + * @throws invalidArgumentException if the given value does not match one of the allowed values
  22 + * (exception is thrown in parent class function)
  23 + */
  24 + static protected function set($value)
  25 + {
  26 + parent::set($value);
  27 + }
  28 +
16 29 }
17 30  
18 31 ?>
19 32 \ No newline at end of file
... ...
lib/api/ktcmis/enums/EnumCapabilityJoin.inc.php
... ... @@ -11,8 +11,21 @@ require_once(CMIS_DIR . '/classes/Enum.inc.php');
11 11  
12 12 class EnumCapabilityJoin extends Enum {
13 13  
14   - static private $values = array('none', 'inneronly', 'innerandouter');
15   - static private $name = 'capabilityJoin';
  14 + static protected $name = 'capabilityJoin';
  15 + static protected $values = array('none', 'inneronly', 'innerandouter');
  16 +
  17 + /**
  18 + * Sets the value of the enumerator
  19 + *
  20 + * @param unknown_type $value
  21 + * @throws invalidArgumentException if the given value does not match one of the allowed values
  22 + * (exception is thrown in parent class function)
  23 + */
  24 + static protected function set($value)
  25 + {
  26 + parent::set($value);
  27 + }
  28 +
16 29 }
17 30  
18 31 ?>
19 32 \ No newline at end of file
... ...
lib/api/ktcmis/enums/EnumCapabilityQuery.inc.php
... ... @@ -11,8 +11,21 @@ require_once(CMIS_DIR . '/classes/Enum.inc.php');
11 11  
12 12 class EnumCapabilityQuery extends Enum {
13 13  
14   - static private $values = array('none', 'metadataonly', 'fulltextonly', 'bothseparate', 'bothcombined');
15   - static private $name = 'capabilityQuery';
  14 + static protected $name = 'capabilityQuery';
  15 + static protected $values = array('none', 'metadataonly', 'fulltextonly', 'bothseparate', 'bothcombined');
  16 +
  17 + /**
  18 + * Sets the value of the enumerator
  19 + *
  20 + * @param unknown_type $value
  21 + * @throws invalidArgumentException if the given value does not match one of the allowed values
  22 + * (exception is thrown in parent class function)
  23 + */
  24 + static protected function set($value)
  25 + {
  26 + parent::set($value);
  27 + }
  28 +
16 29 }
17 30  
18 31 ?>
19 32 \ No newline at end of file
... ...
lib/api/ktcmis/enums/EnumCapabilityRenditions.inc.php
... ... @@ -11,8 +11,21 @@ require_once(CMIS_DIR . '/classes/Enum.inc.php');
11 11  
12 12 class EnumCapabilityRenditions extends Enum {
13 13  
14   - static private $values = array('none', 'objectidsonly', 'properties', 'all');
15   - static private $name = 'capabilityRenditions';
  14 + static protected $name = 'capabilityRenditions';
  15 + static protected $values = array('none', 'objectidsonly', 'properties', 'all');
  16 +
  17 + /**
  18 + * Sets the value of the enumerator
  19 + *
  20 + * @param unknown_type $value
  21 + * @throws invalidArgumentException if the given value does not match one of the allowed values
  22 + * (exception is thrown in parent class function)
  23 + */
  24 + static protected function set($value)
  25 + {
  26 + parent::set($value);
  27 + }
  28 +
16 29 }
17 30  
18 31 ?>
19 32 \ No newline at end of file
... ...