Skip to content

Instantly share code, notes, and snippets.

@bakura10
Created April 2, 2014 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bakura10/9934306 to your computer and use it in GitHub Desktop.
Save bakura10/9934306 to your computer and use it in GitHub Desktop.
<?php
public function getValidationGroupSpecification()
{
if ($this->authorizationService->hasRole('admin')) {
$fields[] = 'password';
}
return [
'put' => ['first_name', 'last_name'] + $fields,
'post' => ['first_name', 'last_name', 'password', 'credit_card']
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment