public function onInsert(EventInterface $event)
    {
        $values = $event->getParam('values');

        $now = new DateTime();
        $now = $now->format('Y-m-d h:i:s');

        $values['created_at'] = $now;
        $values['last_updated_at'] = $now;

        $event->setParam('values', $values);
    }
public function onInsert(EventInterface $event)
    {
        $values = $event->getParam('values');

        $now = new DateTime();
        $now = $now->format('Y-m-d h:i:s');

        $values['created_at'] = $now;
        $values['last_updated_at'] = $now;

        $event->setParam('values', $values);
    }
public function onInsert ( EventInterface $ event ) { $ values = $ event -> getParam ( 'values' ) ; $ now = new DateTime ( ) ; $ now = $ now -> format ( 'Y-m-d h:i:s' ) ; $ values [ 'created_at' ] = $ now ; $ values [ 'last_updated_at' ] = $ now ; $ event -> setParam ( 'values' , $ values ) ; }
Add current `DateTime` value for fields `created_at` and `last_updated_at`

@param EventInterface $event
Add current DateTime value for fields created_at and last_updated_at