Return an array representing a OpenTracking object for the Twilio SendGrid API

@return null|array
351406
public function jsonSerialize()
    {
        return array_filter(
            [
                'enable' => $this->getEnable(),
                'substitution_tag' => $this->getSubstitutionTag()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
271996
public function send()
    {
        if (!$this->auth_code) {
            $this->getAuthCode();
        }

        return [
            'redirect'             => $this->redirect,
            'transactionReference' => $this->transactionReference,
            'auth_code'            => $this->auth_code,
        ];
    }
815070
public function get_results() {
        if (!is_null($this->plan)) {
            return $this->plan->get_results();
        } else {
            debugging('Attempting to get results of a task not binded with a plan', DEBUG_DEVELOPER);
            return null;
        }
    }
1017672
public function serialize()
    {
        $result = [
            'code' => $this->getCode(),
            'message' => $this->getMessage(),
            'errors' => $this->getErrors()
        ];

        $result['data'] = $this->getVariables();

        if ($result['data'] instanceof Traversable) {
            $result['data'] = ArrayUtils::iteratorToArray($result['data']);
        }

        if (null !== $this->jsonpCallback) {
            return $this->jsonpCallback . '(' . Json::encode($result) . ');';
        }

        return Json::encode($result);
    }
1126470
public function getInspectionData()
    {
        return [
            static::PARAM_TIME                   => $this->time,
            static::PARAM_MEMORY                 => $this->memory,
            static::PARAM_EVENT_ID               => $this->eventId,
            static::PARAM_IS_START               => $this->isStart,
            static::PARAM_EVENT                  => $this->event->getObject(),
            static::PARAM_NAME                   => $this->name,
            static::PARAM_TARGET                 => $this->target->getValue(),
            static::PARAM_PARAMS                 => $this->params->getValue(),
            static::PARAM_PROPAGATION_IS_STOPPED => $this->propagationIsStopped,
            static::PARAM_TRACE                  => $this->trace->getValue(),
        ];
    }
1048502
public function createPackage()
    {
        if (!$this->getID()) {
            throw new MissingTrackingParameterException('transaction id is missing');
        }

        return array(
            't' => 'transaction',
            'ti' => $this->getID(),
            'ta' => $this->getAffiliation(),
            'tr' => $this->getRevenue(),
            'ts' => $this->getShipping(),
            'tt' => $this->getTax(),
            'cu' => $this->getCurrency()
        );
    }
33882
public function getData()
    {
        $this->validate('currency', 'description', 'encryptionKey', 'returnUrl');

        // The test mode is included to determine the redirect URL.

        return [
            'VPSProtocol' => $this->VPSProtocol,
            'TxType' => $this->getTxType(),
            'Vendor' => $this->getVendor(),
            'Crypt' => $this->generateCrypt($this->getCryptData()),
            'TestMode' => $this->getTestMode(),
        ];
    }
913064
public function getGoogleTracking()
    {
        /** @var \Ekyna\Bundle\GoogleBundle\Model\TrackingCode $trackingCode */
        $trackingCode = $this->settingManager->getParameter('google.tracking_code');
        if (!$this->debug && 0 < strlen($trackingCode->getPropertyId())) {
            $domain = $trackingCode->getDomain();
            if (0 === strlen($domain)) {
                $domain = 'auto';
            }
            if (in_array($trackingCode->getDomain(), ['none', 'auto'])) {
                $domain = sprintf("'%s'", $domain);
            } else {
                $domain = sprintf("{'cookieDomain': '%s'}", $domain);
            }
            return sprintf(self::GA_TRACKING_CODE, $trackingCode->getPropertyId(), $domain);
        }
        return '';
    }
743782
protected function _fetch() {
		if (!$this->_resource) {
			return false;
		}
		if (!$this->_resource->hasNext()) {
			return null;
		}
		$result = $this->_resource->getNext();

		if ($result instanceof MongoGridFSFile) {
			$result = ['file' => $result] + $result->file;
		}
		return [$this->_iterator, $result];
	}
836646
public function getActiveTimers()
    {
        $result = $this->getActiveUsers( );
        if ( $result->isSuccess() ) {
            $data = array();
            foreach ($result->data as $user) {
                $subResult = $this->getUserEntries( $user->id, Range::today( $this->_timeZone ) );
                if ( $subResult->isSuccess() ) {
                    foreach ($subResult->data as $entry) {
                        if ($entry->timer_started_at != null || $entry->timer_started_at != "") {
                            $data[$user->id] = $entry;
                            break;
                        }
                    }
                }
            }
            $result->data = $data;
        }

        return $result;
    }
1282434
public function getInspectionData()
    {
        return [
            static::PARAM_COMPOSER_JSON      => $this->composer,
            static::PARAM_COMPOSER_LOCK      => $this->composerLock,
            static::PARAM_COMPOSER_INSTALLED => $this->composerInstalled,
        ];
    }
656671
protected function getTrace()
    {
        $backtrace = debug_backtrace();
        $index = null;
        $hasNull = false;
        $realClassName = static::__getRealClassName();
        foreach($backtrace as $i => $item)
        {
            if($realClassName === $item['class'])
            {
                $index = $i + 2;
                break;
            }
        }
        if(null === $index)
        {
            return [];
        }
        return array_splice($backtrace, $index);
    }
560624
public function getRespondentTrack()
    {
        static $respTrack;

        if ($respTrack instanceof \Gems_Tracker_RespondentTrack) {
            return $respTrack;
        }

        $respTrackId = $this->_getParam(\Gems_Model::RESPONDENT_TRACK);
        $tracker     = $this->loader->getTracker();

        if ($respTrackId) {
            $respTrack = $tracker->getRespondentTrack($respTrackId);
        } else {
            if ($this->isMultiTracks()) {
                throw new \Gems_Exception($this->_('No track specified for respondent!'));
            }

            $respondent = $this->getRespondent();
            $respTracks = $tracker->getRespondentTracks(
                    $respondent->getId(),
                    $respondent->getOrganizationId(),
                    array('grc_success DESC', 'gr2t_start_date')
                    );
            $trackId = $this->escort->getTrackId();
            if ($trackId) {
                foreach ($respTracks as $respTrack) {
                    if ($respTrack instanceof \Gems_Tracker_RespondentTrack) {
                        if ($trackId == $respTrack->getTrackId()) {
                            // Return the right track if it exists
                            break;
                        }
                    }
                }
            } else {
                $respTrack = reset($respTracks);
            }
        }
        if (! $respTrack instanceof \Gems_Tracker_RespondentTrack) {
            if ($this->isMultiTracks()) {
                throw new \Gems_Exception($this->_('No track found for respondent!'));
            } else {
                $this->menu->getParameterSource()->offsetSet('track_can_be_created', 1);
                return null;
            }
        }

        $respTrack->applyToMenuSource($this->menu->getParameterSource());

        // Otherwise return the last created track (yeah some implementations are not correct!)
        return $respTrack;
    }
1337021
public function getTrash()
    {
        $oHttpCodes = Factory::service('HttpCodes');

        if (!userHasPermission('admin:cdn:manager:object:browse')) {
            throw new ApiException(
                'You do not have permission to access this resource',
                $oHttpCodes::STATUS_UNAUTHORIZED
            );
        }

        $oInput   = Factory::service('Input');
        $oModel   = Factory::model('ObjectTrash', 'nails/module-cdn');
        $iPage    = (int) $oInput->get('page') ?: 1;
        $aResults = $oModel->getAll(
            $iPage,
            static::MAX_OBJECTS_PER_REQUEST,
            ['sort' => [['trashed', 'desc']]]
        );

        $oResponse = Factory::factory('ApiResponse', 'nails/module-api');
        $oResponse->setData(array_map(
            function ($oObj) {
                $oObj->is_img = isset($oObj->img);
                $oObj->url    = (object) [
                    'src'     => cdnServe($oObj->id),
                    'preview' => isset($oObj->img) ? cdnCrop($oObj->id, 400, 400) : null,
                ];
                return $oObj;
            },
            $aResults
        ));
        return $oResponse;
    }
441342
public function getData()
    {
        $this->validate('transactionReference', 'MD', 'PaRes');

        return [
            'opcode'     => 3,
            'payment_id' => $this->getTransactionReference(),
            'PaRes'      => $this->getPaRes(),
            'MD'         => $this->getMD(),
            'token'      => $this->getRequestToken(),
        ];
    }
304300
private function readAuthObj(){
        $content = @file_get_contents($this->getAuthFilePath());
        if($content !== false){
            $obj = json_decode($content, true);
            $this->isCloudUser = $obj['is_cloud_user'];
            $obj['is_read'] = true;
            if($this->isCloudUser || $obj['time'] + $obj['expires_in'] - 30 > time()){
                return $obj;
            }
        }

        return null;
    }
1275153
public function getRandom()
    {
        $this->internalDataListUpdate();
        $count = sizeof($this->internalDataListData);
        if ($count > 0) {
            $index = rand(0, $count - 1);
            if (isset($this->internalDataListData[$index])) {
                return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, $index);
            }
        }
        return null;
    }