Transform and check the identifier, composite or not.

@param int|string $id

@throws PropertyNotFoundException
483749
private function normalizeIdentifiers($id, ObjectManager $manager, string $resourceClass): array
    {
        $identifierValues = [$id];
        $doctrineClassMetadata = $manager->getClassMetadata($resourceClass);
        $doctrineIdentifierFields = $doctrineClassMetadata->getIdentifier();
        $isOrm = $manager instanceof EntityManagerInterface;
        $isOdm = $manager instanceof DocumentManager;
        $platform = $isOrm ? $manager->getConnection()->getDatabasePlatform() : null;
        $identifiersMap = null;

        if (\count($doctrineIdentifierFields) > 1) {
            $identifiersMap = [];

            // first transform identifiers to a proper key/value array
            foreach (explode(';', (string) $id) as $identifier) {
                if (!$identifier) {
                    continue;
                }

                $identifierPair = explode('=', $identifier);
                $identifiersMap[$identifierPair[0]] = $identifierPair[1];
            }
        }

        $identifiers = [];
        $i = 0;

        foreach ($this->propertyNameCollectionFactory->create($resourceClass) as $propertyName) {
            $propertyMetadata = $this->propertyMetadataFactory->create($resourceClass, $propertyName);

            if (!$propertyMetadata->isIdentifier()) {
                continue;
            }

            $identifier = null === $identifiersMap ? $identifierValues[$i] ?? null : $identifiersMap[$propertyName] ?? null;
            if (null === $identifier) {
                throw new PropertyNotFoundException(sprintf('Invalid identifier "%s", "%s" was not found.', $id, $propertyName));
            }

            $doctrineTypeName = $doctrineClassMetadata->getTypeOfField($propertyName);

            if ($isOrm && null !== $doctrineTypeName && DBALType::hasType($doctrineTypeName)) {
                $identifier = DBALType::getType($doctrineTypeName)->convertToPHPValue($identifier, $platform);
            }
            if ($isOdm && null !== $doctrineTypeName && MongoDbType::hasType($doctrineTypeName)) {
                $identifier = MongoDbType::getType($doctrineTypeName)->convertToPHPValue($identifier);
            }

            $identifiers[$propertyName] = $identifier;
            ++$i;
        }

        return $identifiers;
    }
1373954
public function updateIDValue(&$id)
    {
        $owner = $this->owner;
        if ($owner->Title) {
            $id = Convert::raw2url($owner->Title);
        }
    }
824732
public function where_id_is($id)
        {
            return (Arrays::is($this->_getIdColumnName())) ?
                $this->where($this->_getCompoundIdColumnValues($id), null) :
                $this->where($this->_getIdColumnName(), $id);
        }
79876
private function createPrefix($id)
    {
        $this->prefix = substr($id, self::PREFIX_START, self::PREFIX_LENGTH);
    }
941854
public function get($id)
    {
        if (isset($this->cache[$id])) {
            return $this->cache[$id];
        }

        throw new NotFoundException('No entry was found for this identifier.');
    }
1076853
protected function throwModelNotFoundException($id)
    {
        throw new ModelNotFoundException('Model not found for ID ' . $id . ' on table ' . $this->container->make($this->getModelName())->getTable());
    }
1219965
public function readonly($id) {
		// Format id
		$id = $this->_format($id);
		// Verify existence
		if(!$this->has($id)) {
			throw new NotFoundException("'$id' value does not exist");
		}
		// Set inflector
		$this->values[$id]->addInputInflector(function($value) use($id) {
			throw new ContainerException("Cannot overwrite '$id' value, set in read only mode");
		});
	}
1262702
private function findUser($id)
    {
        if (is_array($id)) {
            /** @var User $user */
            $model = User::findIdentities($id);
        } else {
            /** @var User $user */
            $model = User::findIdentity($id);
        }
        if ($model !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('User not found');
        }
    }
398943
public static function remove($id)
    {
        $s = new static();

        if (is_int($id)) {
            $where = "id = {$id}";
            self::$db->delete($s::$entity_table, $where);
        } else {
            throw new IDShouldBeNumber('Pass in an ID as the parameter, ID has to be a number', 1);
        }
    }
646038
public function read($id) {
		// read
		$model = $this->get($id);

		// check existence
		if ($model === null) {
			return new NotFound(['message' => 'Skill not found.']);
		}

		return new Found(['model' => $model]);
	}
209624
public function delete($id = null) {
		$this->Cliente->id = $id;
		if (!$this->Cliente->exists()) {
			throw new NotFoundException(__('Invalid %s', Configure::read('Mesa.tituloCliente')));
		}
		$this->request->allowMethod('post', 'delete');
		if ($this->Cliente->delete()) {
			$this->Session->setFlash(__('The %s has been deleted.', Configure::read('Mesa.tituloCliente')));
		} else {
			$this->Session->setFlash(__('The %s could not be deleted. Please, try again.', Configure::read('Mesa.tituloCliente')));
		}
		return $this->redirect(array('action' => 'index'));
	}
1337826
public function reverseTransform($id)
    {
        if ('' === $id || null === $id) {
            return;
        }

        if (!is_numeric($id)) {
            throw new UnexpectedTypeException($id, 'numeric'.$id);
        }

        $entity = $this->entityManager->getRepository($this->class)->findOneById($id);

        if ($entity === null) {
            throw new TransformationFailedException(sprintf('The entity with key "%s" could not be found', $id));
        }

        return $entity;
    }
1102570
public function get($id): Domain
    {
        if (!$model = Domain::findOne($id)) {
            throw new NotFoundException($this->i18n->t('setrun/sys/domain', 'Domain is not found'));
        }
        return $model;
    }
533513
public function getPropertyDefinition($id)
    {
        return (isset($this->propertyDefinitions[$id]) ? $this->propertyDefinitions[$id] : null);
    }
909926
public function validateIdentifier($id)
    {
        $printed = print_r($id, true);
        if (count($this->keys) > 1 && !is_array($id)) {
            throw new \RuntimeException("Entity $this->name has a composed key, finding by id requires an array, given: $printed");
        }
        if (count($this->keys) !== count($id)) {
            $keys = print_r($this->keys, true);
            throw new \RuntimeException("Entity $this->name requires the following keys: $keys, given: $printed");
        }
    }
508790
public function setDatatableId($id)
    {
        if (!array_key_exists($id, self::$instances)) {
            self::$instances[$id] = $this;
        } else {
            throw new \Exception('Identifer already exists');
        }

        return $this;
    }
270852
public function get($id)
    {
        if (! $this->has($id)) {
            throw new NotFoundException(
                sprintf('Identifier %s is not defined in container', $id)
            );
        }

        $entry = $this->container[$id]->instance();

        if (is_callable($entry)) {
            return $entry($this);
        }

        return $entry;
    }