Example #1
0
 public static function convertToProveObject($resp, $apiKey)
 {
     $types = array('tel' => 'Prove_tel', 'updated' => 'Prove_Updated', 'created' => 'Prove_Created', 'test' => 'Prove_test', 'verified' => 'Prove_Verified', 'call' => 'Prove_Call', 'text' => 'Prove_Text', 'id' => 'Prove_Id');
     if (self::isList($resp)) {
         $mapped = array();
         foreach ($resp as $i) {
             array_push($mapped, self::convertToProveObject($i, $apiKey));
         }
         return $mapped;
     } else {
         if (is_array($resp)) {
             if (isset($resp['object']) && is_string($resp['object']) && isset($types[$resp['object']])) {
                 $class = $types[$resp['object']];
             } else {
                 $class = 'Prove_Object';
             }
             return Prove_Object::scopedConstructFrom($class, $resp, $apiKey);
         } else {
             return $resp;
         }
     }
 }
Example #2
0
 public static function init()
 {
     self::$_permanentAttributes = new Prove_Util_Set(array('_apiKey', 'id'));
 }