FOF30\Model\DataModel::getAsset PHP Method

getAsset() protected method

This will help tests, too, since we can mock this function.
protected getAsset ( ) : boolean | JTableAsset
return boolean | JTableAsset False on failure, otherwise JTableAsset
    protected function getAsset()
    {
        $name = $this->getAssetName();
        // Do NOT touch JTable here -- we are loading the core asset table which is a JTable, not a F0FTable
        $asset = \JTable::getInstance('Asset');
        if (!$asset->loadByName($name)) {
            return false;
        }
        return $asset;
    }