public function getByCriteria($collection, $criteria)
    {
        if ($data = $this->findOne($collection, $criteria)) {

            /** @var MongoObject $obj */
            $obj = $this->container->get(
                $this->classMap->getClassForResult($collection, $data)
            );
            $obj->setCollection($collection);
            $obj->loadFromArray($data);

            return $obj;
        }

        return null;
    }