0

I have a table named edu2f_jobs_jobs.
This table is received here:

public function getTable($type = 'Job', $prefix = 'Administrator', $config = array())
{
    return parent::getTable($type, $prefix, $config);
}

Inside the JobModel there is a piece of code that does this:

// Get a level row instance.
        $table = $this->getTable();
        // Attempt to load the row.
        if ($table && $table->load($id))
        {


            // Check published state.
            if ($published = $this->getState('filter.published'))
            {
                if (isset($table->state) && $table->state != $published)
                {
                    throw new \Exception(Text::_('COM_JOBS_ITEM_NOT_LOADED'), 403);
                }
            }

            // Convert the Table to a clean CMSObject.
            $properties  = $table->getProperties(1);
            $this->_item = ArrayHelper::toObject($properties, CMSObject::class);

            
        }
        if (empty($this->_item))
        {
            throw new \Exception(Text::_('COM_JOBS_ITEM_NOT_LOADED'), 404);
        }

I get the error because $this->_item is empty.
However I don't know what is causing this or where to look.

Can someone help me with this or why this is happening?

2
  • As it hasn't been mentioned, have you created the Table/JobTable.php file? Mar 16 at 13:15
  • No, I just did and its working now thanks!
    – Jelle
    Apr 3 at 13:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.