public function prependEntities (array $prepended, array $where = []) : void
    {
        $all = $this->getAllEntities($where);
        $index = 0;

        // first prepend
        foreach ($prepended as $prependedEntity)
        {
            $prependedEntity->setSortOrder($index);
            ++$index;
        }

        // then sort the rest
        foreach ($all as $entity)
        {
            if (\in_array($entity, $prepended, true))
            {
                continue;
            }

            $entity->setSortOrder($index);
            ++$index;
        }
    }