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);
                }
            }
        }
    }