public function getPrimaryModel() {
        if ($model = $this->_model) {
            return $model;
        }

        $class = $this->getPrimaryClass();

        if (!$class) {
            return null;
        }

        $this->setPrimaryModel(new $class());

        return $this->_model;
    }