예제 #1
0
 /**
  * set Schema object-level credentials
  *
  * @TODO: this should maybe be in the model?
  * @TODO The models should be defined in an array in this class,
  * along with the methods to call for each. Then we can make it more generic,
  * and much easier to add new objects to
  *
  * @return integer count of agents retrieved
  */
 public function setSchemaCredentials()
 {
     $credentials = SchemaHasUserPeer::doSelectForUser($this->getSubscriberId());
     foreach ($credentials as $credential) {
         $schemaId = $credential->getSchemaId();
         //build the  array
         $credArray[$schemaId]['maintainer'] = $credential->getIsMaintainerFor();
         $credArray[$schemaId]['registrar'] = $credential->getIsRegistrarFor();
         $credArray[$schemaId]['admin'] = $credential->getIsAdminFor();
         $credArray[$schemaId]['contact'] = true;
     }
     if (isset($credArray)) {
         $this->addObjectCredentials('schema', $credArray);
     }
     return count($credentials);
 }