Created
July 31, 2012 17:28
-
-
Save slave2zeros/3218724 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function deleteStepUser($outputFormat=null) | |
{ | |
$this->before($outputFormat); | |
$data = $this->convertInput($this->getDataSource()); | |
$this->checkData($data); | |
$this->checkStep($data); | |
$this->checkUser($data); | |
$goalStepUser = GoalStepUser::findByDql('step_id = ? AND user_id = ? AND team_id IS NULL', array($data['GoalStep']['id'], $data['User']['id']))->getFirst(); | |
if ($goalStepUser) { | |
$goalStepUser->delete(); | |
return $this->output('User step successfully deleted'); | |
} else { | |
return $this->output('User is not associated with this step', null, self::HTTP_BAD_REQUEST); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment