protected function getQuantity(array $insertedPKs)
    {
        if (is_int($this->quantity)) {
            return $this->quantity;
        }

        if ($this->quantity === 'random') {
            return mt_rand(0, count($insertedPKs[$this->relatedClass]));
        }

        return count($insertedPKs[$this->relatedClass]);
    }