Exemple #1
0
 public function toArray($withSubTypes = false, $returnedTypes = array())
 {
     $array = parent::toArray($withSubTypes);
     $array["isFile"] = $this->isFile();
     $array["isOptional"] = $this->isOptional();
     return $array;
 }
function toArrayRecursive(KalturaPropertyInfo $propInfo)
{
    return $propInfo->toArray();
}
 public function toArray($withSubTypes = false)
 {
     $array = array();
     $array["type"] = $this->getType();
     $array["name"] = $this->getName();
     $array["defaultValue"] = $this->getDefaultValue();
     $array["isSimpleType"] = $this->isSimpleType();
     $array["isComplexType"] = $this->isComplexType();
     $array["isFile"] = $this->isFile();
     $array["isEnum"] = $this->isEnum();
     $array["isStringEnum"] = $this->isStringEnum();
     $array["isArray"] = $this->isArray();
     if ($this->isArray()) {
         $propInfo = new KalturaPropertyInfo($this->getArrayType(), "1");
         $array["arrayType"] = $propInfo->toArray();
     }
     $array["isReadOnly"] = $this->isReadOnly();
     $array["isInsertOnly"] = $this->isInsertOnly();
     $array["isWriteOnly"] = $this->isWriteOnly();
     $array["description"] = $this->getDescription() ? $this->getDescription() : "";
     $array["properties"] = array();
     $array["constants"] = array();
     $array["subTypes"] = array();
     $typeReflector = $this->getTypeReflector();
     if ($typeReflector) {
         if ($withSubTypes) {
             $subTypes = $typeReflector->getSubTypesNames();
             foreach ($subTypes as $subType) {
                 $subTypeInfo = new KalturaPropertyInfo($subType, $this->_name);
                 $array["subTypes"][] = $subTypeInfo->toArray();
             }
         }
         foreach ($typeReflector->getProperties() as $prop) {
             $array["properties"][] = $prop->toArray($withSubTypes);
         }
         foreach ($typeReflector->getConstants() as $prop) {
             $array["constants"][] = $prop->toArray();
         }
     }
     return $array;
 }