/**
  * Transform to protection model.
  *
  * @param Entity $protection
  *
  * @return Config[]
  */
 public static function transform(Entity $protection)
 {
     $return = array();
     $path = sprintf(self::path, $protection->getDomain()->getPath(), $protection->getId());
     foreach ($protection->getProtectionuser() as $user) {
         /** @var EntityUser $user */
         $model = new Config();
         $model->setUsername($user->getUsername())->setPassword($user->getPassword())->setPath($path)->setId($user->getProtection()->getId());
         $return[] = $model;
     }
     return $return;
 }