Exemplo n.º 1
0
 /**
  * Handle the command.
  *
  * @param GroupRepositoryInterface $groups
  * @return GroupInterface|null
  */
 public function handle(GroupRepositoryInterface $groups)
 {
     if (is_numeric($this->identifier)) {
         return $groups->find($this->identifier);
     }
     if (is_string($this->identifier)) {
         return $groups->findBySlug($this->identifier);
     }
     if ($this->identifier instanceof Presenter) {
         return $this->identifier->getObject();
     }
     if (is_object($this->identifier)) {
         return $this->identifier;
     }
     return null;
 }