public function getKeywordsFromElements(&$elements = array())
    {
        if (0 === count($elements)) {
            return array();
        }

        $uids = array();
        $assoc = array();
        foreach ($elements as &$element) {
            if ($element instanceof Keyword) {
                $uids[] = $element->value;
                $assoc[$element->value] = &$element;
            } elseif (true === is_string($element)) {
                $uids[] = trim($element);
            }
        }
        unset($element);

        $objects = $this->createQueryBuilder('k')
                ->where('k._uid IN (:uids)')
                ->setParameter('uids', $uids)
                ->getQuery()
                ->getResult();

        foreach ($objects as $object) {
            if (true === array_key_exists($object->getUid(), $assoc)) {
                $assoc[$object->getUid()]->setParam('objectkeyword', [$object]);
            }
        }

        return $objects;
    }