public function getIterator(): \Generator
    {
        foreach ($this->data as $index => $data) {
            if (isset($data[ORMInterface::PIVOT_DATA])) {
                /*
                 * When pivot data is provided we are able to use it as array key.
                 */
                $index = $data[ORMInterface::PIVOT_DATA];
                unset($data[ORMInterface::PIVOT_DATA]);
            }

            yield $index => $this->orm->make(
                $this->class,
                $data,
                ORMInterface::STATE_LOADED,
                true
            );
        }
    }