Skip to content

beforeSave must return true #3

@arielsom

Description

@arielsom

here:
class LogEntry extends Model {

function beforeSave($options) {
    if (empty($this->data['LogEntry']['id'])) {
        $this->data['LogEntry']['url'] = Router::url('', true);
        $this->data['LogEntry']['ip'] = ip2long($_SERVER['REMOTE_ADDR']);
        $this->data['LogEntry']['time'] = time();
        $this->data['LogEntry']['datetime'] = date('Y-m-d H:i:s');
    }
    return true;
}

}

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