public function addtocampaign($data, $form)
    {
        $id = $data['ID'];
        $record = \Page::get()->byID($id);

        $handler = AddToCampaignHandler::create($this, $record);
        $results = $handler->addToCampaign($record, $data);
        if (is_null($results)) {
            return null;
        }

        if ($this->getSchemaRequested()) {
            // Send extra "message" data with schema response
            $extraData = ['message' => $results];
            $schemaId = Controller::join_links($this->Link('schema/AddToCampaignForm'), $id);
            return $this->getSchemaResponse($schemaId, $form, null, $extraData);
        }

        return $results;
    }
public function addtocampaign($data, $form)
    {
        $id = $data['ID'];
        $record = \Page::get()->byID($id);

        $handler = AddToCampaignHandler::create($this, $record);
        $results = $handler->addToCampaign($record, $data);
        if (is_null($results)) {
            return null;
        }

        if ($this->getSchemaRequested()) {
            // Send extra "message" data with schema response
            $extraData = ['message' => $results];
            $schemaId = Controller::join_links($this->Link('schema/AddToCampaignForm'), $id);
            return $this->getSchemaResponse($schemaId, $form, null, $extraData);
        }

        return $results;
    }
public function addtocampaign ( $ data , $ form ) { $ id = $ data [ 'ID' ] ; $ record = \ Page :: get ( ) -> byID ( $ id ) ; $ handler = AddToCampaignHandler :: create ( $ this , $ record ) ; $ results = $ handler -> addToCampaign ( $ record , $ data ) ; if ( is_null ( $ results ) ) { return null ; } if ( $ this -> getSchemaRequested ( ) ) { // Send extra "message" data with schema response $ extraData = [ 'message' => $ results ] ; $ schemaId = Controller :: join_links ( $ this -> Link ( 'schema/AddToCampaignForm' ) , $ id ) ; return $ this -> getSchemaResponse ( $ schemaId , $ form , null , $ extraData ) ; } return $ results ; }
Action handler for adding pages to a campaign

@param array $data
@param Form $form
@return DBHTMLText|HTTPResponse
Action handler for adding pages to a campaign