Exemple #1
0
 /**
  * Loads a DeveloperApp/CompanyApp object with the contents of a raw
  * Management API response.
  *
  * @static
  * @param AbstractApp $obj
  * @param array $response
  */
 protected static function loadFromResponse(AbstractApp &$obj, array $response, $owner_identifier = null)
 {
     $obj->accessType = $response['accessType'];
     $obj->appFamily = isset($response['appFamily']) ? $response['appFamily'] : null;
     $obj->appId = $response['appId'];
     $obj->callbackUrl = $response['callbackUrl'];
     $obj->createdAt = $response['createdAt'];
     $obj->createdBy = $response['createdBy'];
     $obj->modifiedAt = $response['lastModifiedAt'];
     $obj->modifiedBy = $response['lastModifiedBy'];
     $obj->name = $response['name'];
     $obj->scopes = $response['scopes'];
     $obj->status = $response['status'];
     $obj->readAttributes($response);
     if (!empty($response['description'])) {
         $obj->description = $response['description'];
     } elseif (isset($obj->attributes['description'])) {
         $obj->description = $obj->getAttribute('description');
     } else {
         $obj->description = null;
     }
     self::loadCredentials($obj, $response['credentials']);
     // Let subclasses twiddle here
     $obj::afterLoad($obj, $response, $owner_identifier);
 }
Exemple #2
0
 public function getAppProperties($class = __CLASS__)
 {
     $properties = parent::getAppProperties(__CLASS__);
     $properties[] = 'developerId';
     $properties[] = 'developer';
     return $properties;
 }
Exemple #3
0
 public function getAppProperties($class = __CLASS__)
 {
     $properties = parent::getAppProperties(__CLASS__);
     $properties[] = 'companyName';
     return $properties;
 }