Exemplo n.º 1
0
 /**
  * @param array $params
  *
  * @return ChangeOp[]
  */
 private function getChangeOps(array $params)
 {
     $changeOps = array();
     foreach ($params['claim'] as $guid) {
         $changeOps[] = $this->statementChangeOpFactory->newRemoveStatementOp($guid);
     }
     return $changeOps;
 }
 /**
  * Get changeops that remove all claims that have the 'remove' key in the array
  *
  * @param array[] $claims array of serialized claims
  *
  * @return ChangeOp[]
  */
 private function getRemoveStatementChangeOps(array $claims)
 {
     $opsToReturn = array();
     foreach ($claims as $claimArray) {
         if (array_key_exists('remove', $claimArray)) {
             if (array_key_exists('id', $claimArray)) {
                 $opsToReturn[] = $this->statementChangeOpFactory->newRemoveStatementOp($claimArray['id']);
             } else {
                 $this->errorReporter->dieError('Cannot remove a claim with no GUID', 'invalid-claim');
             }
         }
     }
     return $opsToReturn;
 }