Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

validating and validated events observable fix #153

Merged
merged 1 commit into from
Feb 25, 2014
Merged

validating and validated events observable fix #153

merged 1 commit into from
Feb 25, 2014

Commits on Jan 14, 2014

  1. 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.
    unstoppablecarl committed Jan 14, 2014
    Configuration menu
    Copy the full SHA
    e7c1659 View commit details
    Browse the repository at this point in the history