コード例 #1
0
 public function testGetTypeTypeMutabilityKeysReturnsContentOfStaticArray()
 {
     $this->assertSame($this->getStaticAttribute('\\Dkd\\PhpCmis\\Bindings\\Browser\\JSONConstants', 'TYPE_TYPE_MUTABILITY_KEYS'), JSONConstants::getTypeTypeMutabilityKeys());
 }
コード例 #2
0
 /**
  * Convert an array to a type mutability object
  *
  * @param array|null $data The data that should be populated to the object
  * @return TypeMutability|null Returns the type mutability object or <code>null</code> if empty array is given
  */
 public function convertTypeMutability(array $data = null)
 {
     if (empty($data)) {
         return null;
     }
     $typeMutability = new TypeMutability();
     $typeMutability->populate($data, array_combine(JSONConstants::getTypeTypeMutabilityKeys(), array_map(function ($key) {
         // add a prefix "can" to all keys as this are the property names
         return 'can' . ucfirst($key);
     }, JSONConstants::getTypeTypeMutabilityKeys())), true);
     $typeMutability->setExtensions($this->convertExtension($data, JSONConstants::getTypeTypeMutabilityKeys()));
     return $typeMutability;
 }