This repository was archived by the owner on Jul 16, 2023. It is now read-only.
Commit e7c1659
committed
validating and validated events observable fix
The validating event works when bound in the boot() function with the following code.
<?php
class Record extends Ardent{
static public function boot(){
parent::boot();
self::validating(function($record){
// this always works
});
}
}
The observable object binding of the validating event only works if the $observables property includes "validating" in its array and is subsequently returned in the array when calling getObservableEvents().
<?php
class Record extends Ardent{
// only works if this is set
public $observables = array('validating');
}
class Observer {
public function validating($model){
// works if $observables = array('validating');
}
}
Record::observe(new Observer);
The getObservableEvents() needs to be extended in the Ardent class to work correctly.1 parent e98ed2d commit e7c1659
1 file changed
+11
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
862 | 862 | | |
863 | 863 | | |
864 | 864 | | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
865 | 876 | | |
0 commit comments