src/Traits/BaseTrait.php
private function internalChangingHooks($key, $value, $oldValue = null, $type = 'insert')
    {
        switch (trim(strtolower($type))) {
            case 'update':
                $hook = 'updateHook';
                if (method_exists($this, $hook)) {
                    $this->$hook($key, $value, $oldValue);
                }
                break;
            case 'remove':
                $hook = 'removeHook';
                if (method_exists($this, $hook)) {
                    $this->$hook($key, $oldValue);
                }
                break;
            case 'insert':
                $hook = 'insertHook';
                if (method_exists($this, $hook)) {
                    $this->$hook($key, $value);
                }
                break;
        }
    }
private function internalChangingHooks($key, $value, $oldValue = null, $type = 'insert')
    {
        switch (trim(strtolower($type))) {
            case 'update':
                $hook = 'updateHook';
                if (method_exists($this, $hook)) {
                    $this->$hook($key, $value, $oldValue);
                }
                break;
            case 'remove':
                $hook = 'removeHook';
                if (method_exists($this, $hook)) {
                    $this->$hook($key, $oldValue);
                }
                break;
            case 'insert':
                $hook = 'insertHook';
                if (method_exists($this, $hook)) {
                    $this->$hook($key, $value);
                }
                break;
        }
    }
private function internalChangingHooks ( $ key , $ value , $ oldValue = null , $ type = 'insert' ) { switch ( trim ( strtolower ( $ type ) ) ) { case 'update' : $ hook = 'updateHook' ; if ( method_exists ( $ this , $ hook ) ) { $ this -> $ hook ( $ key , $ value , $ oldValue ) ; } break ; case 'remove' : $ hook = 'removeHook' ; if ( method_exists ( $ this , $ hook ) ) { $ this -> $ hook ( $ key , $ oldValue ) ; } break ; case 'insert' : $ hook = 'insertHook' ; if ( method_exists ( $ this , $ hook ) ) { $ this -> $ hook ( $ key , $ value ) ; } break ; } }
check for existing of changing element hook method in current object and
send the key, the value and the old value of to it. tis helps you to have
an active array
@param mixed $key the key of the element
@param mixed $value the value of the element
@param mixed $oldValue the old value of the element
@param string $type the type of changing (insert|update|remove)
@return void
check for existing of changing element hook method in current object and send the key the value and the old value of to it . tis helps you to have an active array