public function handleBeforeFieldUpdate(array $fieldData)
    {
        static $running = array();

        // Process any events
        $trackEngine = $this->getTrackEngine();

        if (! $trackEngine) {
            return array();
        }

        $event = $trackEngine->getFieldBeforeUpdateEvent();

        if (! $event) {
            return array();
        }

        if (isset($running[$this->_respTrackId])) {
            throw new \Gems_Exception(sprintf(
                    "Nested calls to '%s' track before field update event are not allowed.",
                    $trackEngine->getName()
                    ));
        }
        $running[$this->_respTrackId] = true;

        $output = $event->prepareFieldUpdate($fieldData, $this);

        unset($running[$this->_respTrackId]);

        return $output;
    }
public function handleBeforeFieldUpdate(array $fieldData)
    {
        static $running = array();

        // Process any events
        $trackEngine = $this->getTrackEngine();

        if (! $trackEngine) {
            return array();
        }

        $event = $trackEngine->getFieldBeforeUpdateEvent();

        if (! $event) {
            return array();
        }

        if (isset($running[$this->_respTrackId])) {
            throw new \Gems_Exception(sprintf(
                    "Nested calls to '%s' track before field update event are not allowed.",
                    $trackEngine->getName()
                    ));
        }
        $running[$this->_respTrackId] = true;

        $output = $event->prepareFieldUpdate($fieldData, $this);

        unset($running[$this->_respTrackId]);

        return $output;
    }
public function handleBeforeFieldUpdate ( array $ fieldData ) { static $ running = array ( ) ; // Process any events $ trackEngine = $ this -> getTrackEngine ( ) ; if ( ! $ trackEngine ) { return array ( ) ; } $ event = $ trackEngine -> getFieldBeforeUpdateEvent ( ) ; if ( ! $ event ) { return array ( ) ; } if ( isset ( $ running [ $ this -> _respTrackId ] ) ) { throw new \ Gems_Exception ( sprintf ( "Nested calls to '%s' track before field update event are not allowed." , $ trackEngine -> getName ( ) ) ) ; } $ running [ $ this -> _respTrackId ] = true ; $ output = $ event -> prepareFieldUpdate ( $ fieldData , $ this ) ; unset ( $ running [ $ this -> _respTrackId ] ) ; return $ output ; }
Find out if there are before field update events and delegate to the event if needed

@param array $fieldData fieldname => value + codename => value
@return array Of changed fields. Codename using items overwrite any key using items
Find out if there are before field update events and delegate to the event if needed