array('id' => 12, 'name' => 'Twelve'), 34 => array('id' => 34, 'name' => 'Thirty four'), 56 => array('id' => 56, 'name' => 'Fifty six'), ); // ALTERNATIVE: $returnValues = array(); // OK, success // ALTERNATIVE: $returnValues = array("Some value"); // OK, return a single value // Spec: civicrm_api3_create_success($values = 1, $params = array(), $entity = NULL, $action = NULL) return civicrm_api3_create_success($returnValues, $params, 'NewEntity', 'NewAction'); } else { throw new API_Exception(/*errorMessage*/ 'Everyone knows that the magicword is "sesame"', /*errorCode*/ 1234); } }