activity/logger/logger.php
public function log($action, KModelEntityInterface $object, KObjectIdentifierInterface $subject)
    {
        $controller = $this->getObject($this->_controller);

        if($controller instanceof KControllerModellable)
        {
            foreach($object as $entity)
            {
                // Only log if the entity status is valid.
                $status = $this->getActivityStatus($entity, $action);

                if (!empty($status) && $status !== KModelEntityInterface::STATUS_FAILED)
                {
                    // Get the activity data
                    $data = $this->getActivityData($entity, $subject, $action);

                    // Set the status
                    if(!isset($data['status'] )) {
                        $data['status'] = $status;
                    }

                    // Set the action
                    if(!isset($data['action']))
                    {
                        $parts = explode('.', $action);
                        $data['action'] = $parts[1];
                    }

                    $controller->add($data);
                }
            }
        }
    }
public function log($action, KModelEntityInterface $object, KObjectIdentifierInterface $subject)
    {
        $controller = $this->getObject($this->_controller);

        if($controller instanceof KControllerModellable)
        {
            foreach($object as $entity)
            {
                // Only log if the entity status is valid.
                $status = $this->getActivityStatus($entity, $action);

                if (!empty($status) && $status !== KModelEntityInterface::STATUS_FAILED)
                {
                    // Get the activity data
                    $data = $this->getActivityData($entity, $subject, $action);

                    // Set the status
                    if(!isset($data['status'] )) {
                        $data['status'] = $status;
                    }

                    // Set the action
                    if(!isset($data['action']))
                    {
                        $parts = explode('.', $action);
                        $data['action'] = $parts[1];
                    }

                    $controller->add($data);
                }
            }
        }
    }
public function log ( $ action , KModelEntityInterface $ object , KObjectIdentifierInterface $ subject ) { $ controller = $ this -> getObject ( $ this -> _controller ) ; if ( $ controller instanceof KControllerModellable ) { foreach ( $ object as $ entity ) { // Only log if the entity status is valid. $ status = $ this -> getActivityStatus ( $ entity , $ action ) ; if ( ! empty ( $ status ) && $ status !== KModelEntityInterface :: STATUS_FAILED ) { // Get the activity data $ data = $ this -> getActivityData ( $ entity , $ subject , $ action ) ; // Set the status if ( ! isset ( $ data [ 'status' ] ) ) { $ data [ 'status' ] = $ status ; } // Set the action if ( ! isset ( $ data [ 'action' ] ) ) { $ parts = explode ( '.' , $ action ) ; $ data [ 'action' ] = $ parts [ 1 ] ; } $ controller -> add ( $ data ) ; } } } }
Log an activity.

@param string                     $action  The action to log.
@param KModelEntityInterface      $object  The activity object on which the action is performed.
@param KObjectIdentifierInterface $subject The activity subject who is performing the action.
Log an activity .