controller/activity.php
protected function _beforeAdd(KControllerContextInterface $context)
    {
        $context->request->data->ip = $this->getObject('request')->getAddress();
    }
protected function _beforeAdd(KControllerContextInterface $context)
    {
        $context->request->data->ip = $this->getObject('request')->getAddress();
    }
protected function _beforeAdd ( KControllerContextInterface $ context ) { $ context -> request -> data -> ip = $ this -> getObject ( 'request' ) -> getAddress ( ) ; }
Set the IP address if we are adding a new activity.

@param KControllerContextInterface $context A command context object.
@return KModelEntityInterface
Set the IP address if we are adding a new activity .