Skip to content

Observers not working #221

@paulcanning

Description

@paulcanning

I am trying to get a simple observer working, but to no avail.

I am using the following code (as shown in the documentation)

class Business_model extends MY_Model
{
    public $_table = 'business';
    public $before_get = array('timestamps');

    protected function timestamps($row)
    {
        $row['created_at'] = $row['updated_at'] = date('Y-m-d H:i:s');
    return $row;
    }
}

Checking the variables using a break point, shows that the object returned does not contain the created_at or updated_at data.

Do I need to enable the triggers somehow?

I am using CI3 btw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions