Advanced components - Eventlisteners - Listening events.php 307 Bytes
Newer Older
doctrine's avatar
doctrine committed
1
<?php
2
$table = $conn->getTable("User");
doctrine's avatar
doctrine committed
3 4 5 6 7 8 9 10 11 12 13

$table->setEventListener(new MyListener2());

// retrieve user whose primary key is 2
$user    = $table->find(2);

$user->name = "John Locke";

// update event will be listened and current time will be assigned to the field 'updated' 
$user->save();
?>