@param int $id Image ID

@return \Darvin\ImageBundle\Entity\Image\AbstractImage
@throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
338360
private function getImage($id)
    {
        $image = $this->getImageRepository()->find($id);

        if (empty($image)) {
            throw $this->createNotFoundException(sprintf('Unable to find image by ID "%d".', $id));
        }

        return $image;
    }
191651
public function AnimePictures(int $id): array
    {
        return $this->myanimelist->getAnimePictures(
            new Request\Anime\AnimePicturesRequest($id)
        );
    }
1005709
public static function getImages($id)
    {
        global $config;
        $events=self::getEvents($id);
        $img=new archiImage();
        foreach ($events as $event) {
            $params = array("select"=>"hi1.idImage, hi1.dateUpload, hi1.idHistoriqueImage", "idEvenement"=>$event["idEvenementAssocie"]);
            $res=$config->connexionBdd->requete($img->getImagesFromEvenement($params));
            while ($image=mysql_fetch_object($res)) {
                $return[] =$image;
            }
        }
        return $return;
    }
72864
protected function findModel(int $id)
    {
        $settingModelClass = $this->modelClass;

        if (($model = $settingModelClass::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(Yii::t('yii2mod.settings', 'The requested page does not exist.'));
        }
    }
242528
protected function getMedia($id)
    {
        $media = $this->getMediaManager()->findOneBy(['id' => $id]);

        if (null === $media) {
            throw new NotFoundHttpException(sprintf('Media (%d) not found', $id));
        }

        return $media;
    }
1146757
public function convert($id)
    {
        if (null === $application = $this->repository->find((int) $id)) {
            throw new NotFoundHttpException(sprintf('Application %s not found.', $id));
        }

        return $application;
    }
54724
public function get($id) {
		foreach($this->values as $container) {
			if($container->has($id)) {
				return $container->get($id);
			}
		}
		throw new NotFoundException("'$id' value not found");
	}
279921
public function removeFilterByID($id)
    {
        $this->filters = $this->filters->reject(function (AbstractFilter $filter) use ($id) {
            return $filter->getId() == $id;
        });
    }
800301
public function findById(int $id)
    {
        $entity = null;

        for ($i = 0; $i < count($this->registries); $i++) {
            /** @var RegistryInterface $registry */
            $registry = $this->registries[ $i ];
            $entity = $registry->findByKey($id);

            if ($entity instanceof AbstractEntity) {
                $this->updateRegistries([$entity], $i - 1);
                break;
            }
        }

        return $entity;
    }
88645
public function get($id)
    {
        if (false === $this->has($id)) {
            $errMsg = sprintf('Invalid create %s', $id);
            throw new Exception\NotFoundDoctrineObjectHydratorException($errMsg);
        }

        return clone $this->prototype[$id];
    }
568223
public function previousChild(int $id): AbstractNode
    {
        $child = $this->getchild($id);
        $next  = $this->children[$child->id()]['prev'];
        if (is_null($next)) {
            throw new ChildNotFoundException("Child '$id' previous not found in this node.");
        }

        return $this->getChild($next);
    }
130824
public function enableAction($id)
    {
        $image = $this->getImage($id);

        if ($image->isEnabled()) {
            throw $this->createNotFoundException(sprintf('Image with ID "%d" already enabled.', $id));
        }

        $image->setEnabled(true);

        $this->getDoctrine()->getManager()->flush();

        return new Response();
    }
548007
public function deleteAction($id)
    {
        if (null === $media = $this->getMediaRepository()->find($id)) {
            throw new NotFoundHttpException(sprintf('Cannot find media with id `%s`.', $id));
        }

        $em = $this->getEntityManager();

        try {
            $em->getRepository('BackBee\ClassContent\AbstractClassContent')->deleteContent($media->getContent(), true);
            $em->remove($media);
            $em->flush();
        } catch (\Exception $e) {
            throw new BadRequestHttpException(sprintf('Error while deleting media `%s`: %s', $id, $e->getMessage()));
        }

        return $this->createJsonResponse(null, 204);
    }
824908
public function get(int $id)
    {
        if ($id === null) {
            return null;
        }

        if (isset($this->entities[$id])) {
            return $this->entities[$id];
        }

        // Entities are mutable
        // Search through the previously null-id entities
        // in case an id has been set now.
        foreach ($this->nullIdEntities as $entity) {
            if ($entity->getId() === $id) {
                return $entity;
            }
        }

        return null;
    }
1056974
public function getImagesByArticles($id)
    {
        $uri = Article::$object_endpoint . '/' . $id . '/' . Image::$object_endpoint;
        return $this->get($uri);
    }
1061883
public function getById($id)
    {
        $ip = $this->adapter->get(sprintf('%s/floating_ips/%s', $this->endpoint, $id));

        $ip = json_decode($ip);

        return new FloatingIpEntity($ip->floating_ip);
    }
807257
public function getOrFail($id)
    {
        if (!$this->storage->offsetExists($id)) {
            throw new ResourceNotFoundException("Model with id #$id not found.");
        }
        return $this->deserializeFromStorage($this->storage->offsetGet($id));
    }