public function getEntity($key)
    {
        foreach ($this->entities as $entityKey => $entityVal) {
            if ($entityKey==$key) {
                return $entityVal;
            }
        }
        return null;
    }