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;
    }
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;
    }
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 ; }
Finds an entity by its id

@param int $id

@return AbstractEntity|null
Finds an entity by its id