Stevemo\Cpanel\Group\Repo\CpanelGroupInterface::update PHP Method

update() public method

Update a group
Author: Steve Montambeault
public update ( array $attributes ) : boolean
$attributes array
return boolean
    public function update(array $attributes);

Usage Example

Ejemplo n.º 1
0
 /**
  * Update a group
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @param array $data
  *
  * @return Bool
  */
 public function update(array $data)
 {
     try {
         if ($this->validator->with($data)->validForUpdate()) {
             $this->groups->update($data);
             return true;
         }
     } catch (GroupExistsException $e) {
         $this->validator->add('GroupExistsException', $e->getMessage());
     } catch (NameRequiredException $e) {
         $this->validator->add('NameRequiredException', $e->getMessage());
     }
     return false;
 }