public function createContent(Location $location = null, Campaign $campaign = null)
    {
        $connection = $this->getRestApiConnectionByLocation($location);
        $remoteContentTypes = $connection->getContentTypes();

        foreach($remoteContentTypes as $remoteContentType){
            $id = $location->getId().'-'.$remoteContentType['id'];
            $name = $remoteContentType['names']['value'][0]['#text'];
            $contentTypes[$id] = $name;
        }

        return $contentTypes;
    }
public function createContent(Location $location = null, Campaign $campaign = null)
    {
        $connection = $this->getRestApiConnectionByLocation($location);
        $remoteContentTypes = $connection->getContentTypes();

        foreach($remoteContentTypes as $remoteContentType){
            $id = $location->getId().'-'.$remoteContentType['id'];
            $name = $remoteContentType['names']['value'][0]['#text'];
            $contentTypes[$id] = $name;
        }

        return $contentTypes;
    }
public function createContent ( Location $ location = null , Campaign $ campaign = null ) { $ connection = $ this -> getRestApiConnectionByLocation ( $ location ) ; $ remoteContentTypes = $ connection -> getContentTypes ( ) ; foreach ( $ remoteContentTypes as $ remoteContentType ) { $ id = $ location -> getId ( ) . '-' . $ remoteContentType [ 'id' ] ; $ name = $ remoteContentType [ 'names' ] [ 'value' ] [ 0 ] [ '#text' ] ; $ contentTypes [ $ id ] = $ name ; } return $ contentTypes ; }
When a new Activity is being created, this handler method will be called
to retrieve a new Content object for the Activity.

Called in these views:
- new

@param Location $location
@param Campaign $campaign
@return null
When a new Activity is being created this handler method will be called to retrieve a new Content object for the Activity .