OEModule\PASAPI\models\PasApiAssignment::getInternal PHP Method

getInternal() public method

if force_create is true, it will create a new instance if the internal id cannot find the internal model. This allows for fault tolerance on internal models that might be deleted by other means.
public getInternal ( boolean $force_create = false ) : CActiveRecord
$force_create boolean
return CActiveRecord
    public function getInternal($force_create = false)
    {
        if ($this->internal_id) {
            $internal = self::model($this->internal_type)->findByPk($this->internal_id);
            if (!$internal && $force_create) {
                $this->internal_id = null;
                $internal = new $this->internal_type();
            }
            return $internal;
        } else {
            return new $this->internal_type();
        }
    }