Access the samples

@return \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleList
425873
protected function getSamples() {
        if (!$this->_samples) {
            $this->_samples = new SampleList(
                $this->version,
                $this->solution['assistantSid'],
                $this->solution['sid']
            );
        }

        return $this->_samples;
    }
742406
protected static function _discover_tasks()
	{
		$result = array();
		$files = \Finder::instance()->list_files('tasks');

		if (count($files) > 0)
		{
			foreach ($files as $file)
			{
				$task_name = str_replace('.php', '', basename($file));
				$class_name = '\\Fuel\\Tasks\\'.$task_name;

				require $file;

				$reflect = new \ReflectionClass($class_name);

				// Ensure we only pull out the public methods
				$methods = $reflect->getMethods(\ReflectionMethod::IS_PUBLIC);

				$result[$task_name] = array();

				if (count($methods) > 0)
				{
					foreach ($methods as $method)
					{
						strpos($method->name, '_') !== 0 and $result[$task_name][] = $method->name;
					}
				}
			}
		}

		return $result;
	}
911402
public function applicationsListAction()
	{
		$manager = $this->getPageApplicationManager();

		$responseData = array();

		foreach ($manager->getAllApplications() as $application) {
			$responseData[] = array(
				'id'		=> $application->getId(),
				'title'		=> $application->getTitle(),
				'icon'		=> $application->getIcon(),
				'isDropTarget' => $application->getAllowChildren(),
				'childInsertPolicy' => $application->getNewChildInsertPolicy(),
			);
		}

		return new SupraJsonResponse($responseData);
	}
180186
public function getList()
    {
        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');
        $oObjectModel = Factory::model('Object', 'nails/module-cdn');
        $iBucketId    = (int) $oInput->get('bucket_id') ?: null;
        $iPage        = (int) $oInput->get('page') ?: 1;

        if (empty($iBucketId)) {
            throw new ApiException(
                '`bucket_id` is a required field',
                $oHttpCodes::STATUS_BAD_REQUEST
            );
        }

        $aObjects = $oObjectModel->getAll(
            $iPage,
            static::CONFIG_OBJECTS_PER_PAGE,
            ['where' => [['bucket_id', $iBucketId]]]
        );

        return Factory::factory('ApiResponse', 'nails/module-api')
            ->setData(array_map(
                function ($oObj) {
                    $oObj->url->preview = $oObj->is_img ? cdnCrop($oObj->id, 400, 400) : null;
                    return $oObj;
                },
                $aObjects
            ))
            ->setMeta([
                'page'     => $iPage,
                'per_page' => static::CONFIG_OBJECTS_PER_PAGE,
            ]);
    }
661302
protected function getDataSessions() {
        if (!$this->_dataSessions) {
            $this->_dataSessions = new DataSessionList($this->version, $this->solution['sid']);
        }

        return $this->_dataSessions;
    }
144243
protected function getListCredential()
    {
        $options = $this->query_filter;
        $options['limit'] = $this->data_limit;

        return $this->credential->getList($options);
    }
849054
protected function getViewData()
    {
        $user = \common_session_SessionManager::getSession()->getUser();
        $hasAccessToReactivate = AclProxy::hasAccess($user, MonitorProctorAdministrator::class, 'reactivateExecutions', array());
        $delivery = $this->getCurrentDelivery();
        $guiSettingsService = $this->getServiceLocator()->get(GuiSettingsService::SERVICE_ID);
        $assessmentResultsService = $this->getServiceLocator()->get(AssessmentResultsService::SERVICE_ID);
        $data = [
            'ismanageable' => false,
            'set' => [],
            'extrafields' => DeliveryHelper::getExtraFields(),
            'categories' => DeliveryHelper::getAllReasonsCategories($hasAccessToReactivate),
            'printReportButton' => $assessmentResultsService->getOption(AssessmentResultsService::OPTION_PRINT_REPORT_BUTTON),
            'printReportUrl' => $assessmentResultsService->getScoreReportUrlParts(),
            'timeHandling' => $this->getServiceLocator()->get(DeliveryExecutionStateService::SERVICE_ID)->getOption(DeliveryExecutionStateService::OPTION_TIME_HANDLING),
            'historyUrl' => $this->getServiceLocator()->get(TestSessionHistoryService::SERVICE_ID)->getHistoryUrl($delivery),
            'refreshBtn' => $guiSettingsService->getOption(GuiSettingsService::PROCTORING_REFRESH_BUTTON),
            'autoRefresh' => $guiSettingsService->getOption(GuiSettingsService::PROCTORING_AUTO_REFRESH),
            'canPause' => $guiSettingsService->getOption(GuiSettingsService::PROCTORING_ALLOW_PAUSE),
            'onlineStatus' => $this->getServiceLocator()->get(TestSessionConnectivityStatusService::SERVICE_ID)->hasOnlineMode(),
            'hasAccessToReactivate' => $hasAccessToReactivate
        ];

        if (!is_null($delivery)) {
            $data['delivery'] = $delivery->getUri();
        }
        if ($this->hasRequestParameter('context')) {
            $data['context'] = $this->getRequestParameter('context');
        }

        return $data;
    }
508883
public function sample2()
   {
      $data = array(
                  "NAME"       => 'Juliet & Romeo',
                  "EMAIL"      => 'some_email@example.com',
                  "MESSAGE"    => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt, ad labore iusto quibusdam totam. Repellendus, architecto quos temporibus dolores assumenda amet veritatis quisquam!',
                  "DATE"       => date('Y-m-d H:i:s'),
                  "SMALL_TEXT" => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.
                                    Sapiente, fugiat consequatur illo eaque ipsam expedita sint itaque quibusdam porro fugit quas quae placeat
                                    qui fuga sequi aspernatur nam quo quis.',
                  );

      $template_html = 'sample-2.html';

      $mail = new Mail();
      $mail->setMailBody($data, $template_html);
      $mail->sendMail('Test Sample 2 Assoc Array with an external template and plain-text file');
      exit('Message Sent!');
   }
576292
public function actionTasklist()
    {
        $projectID = $this->getRequestParam('projectid');

        $project = new Project();
        $tasks = $project->getTasks($projectID);

        return $this->render('tasklist', [
            'projectid' => $projectID,
            'tasks' => $tasks,
        ]);
    }
869668
public function getRawAnswers()
    {
        if (! is_array($this->_sourceDataRaw)) {
            $this->_sourceDataRaw = $this->getSurvey()->getRawTokenAnswerRow($this->_tokenId);
        }
        return $this->_sourceDataRaw;
    }
60247
public function get_samples($sampleids) {
        global $DB;

        list($sql, $params) = $DB->get_in_or_equal($sampleids, SQL_PARAMS_NAMED);
        $users = $DB->get_records_select('user', "id $sql", $params);

        $userids = array_keys($users);
        $sampleids = array_combine($userids, $userids);

        $users = array_map(function($user) {
            return ['user' => $user, 'context' => \context_user::instance($user->id)];
        }, $users);

        // No related data attached.
        return [$sampleids, $users];
    }
76177
public function getList()
    {
        $siteId = $this->getRequestSiteId();

        //ACCESS CHECK
        $sitePagesResource = $this->getSitePagesResourceId($siteId);
        if (!$this->isAllowed('pages', 'read')
            && !$this->isAllowed(
                $sitePagesResource,
                'read'
            )
        ) {
            $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);

            return $this->getResponse();
        }

        $site = $this->getSite($siteId);

        if (empty($site)) {
            return new ApiJsonModel(
                null,
                1,
                "Site was not found with id {$siteId}."
            );
        }

        $pages = $site->getPages();

        foreach ($pages as $key => $page) {
            $apiResponse = new SitePageApiResponse($page);

            $pages[$key] = $apiResponse;
        }

        return new ApiJsonModel(
            $pages,
            0,
            'Success'
        );
    }
66747
public function getPreparedData()
    {
        $params = $this->getData();

        if ($this->authorize) {
            $params = array_merge($params, $this->authenticationData($params));
        }

        return $params;
    }
97563
public function getTaskList()
    {
        $tasks = $this->loader->loadTasks();

        return array_map(function (Task $task) {
            return $task->getName();
        }, $tasks);
    }
1162923
def get_sampletypes(self):
        
        query = {
            "portal_type": "SampleType",
            "sort_on": "sortable_title",
            "sort_order": "ascending",
            "is_active": True,
        }
        results = api.search(query, "bika_setup_catalog")
        return map(api.get_object, results)
1344151
public function getList()
	{
		$this->getResponse()
			->setStatusCode(Response::STATUS_CODE_200);
		
		// 1) getting params
		$page = (int) $this->params()->fromQuery("page", 1);
		$category = $this->params()->fromQuery("category", "usato");
		$purpose = $this->params()->fromQuery("purpose", "compravendita");
		$location = $this->params()->fromQuery("location", "italia");
		$limit = 30;
		$offset = ($page * $limit) - $limit;
		$returnSelect = true;
		
		// 2) Discard useless params and prepare them to be passed to the model
		$params = $this->requestToSearchParams($this->params()->fromQuery());
		$params = is_array($params) ? $params + compact('returnSelect', 'offset', 'limit') : array();
		
		if(empty($params)) {
            return new JsonModel(array());
		}
		
		// 3) get only for current user?
		$onlyCurrentUser = (bool) $this->params()->fromQuery("current", false);
		$k = 0;
		foreach($params['field'] as $f) {
			if('current' == $f || 'user' == $f) {
				unset($params['field'][$k]);
				unset($params['value'][$k]);
			}
			$k++;
		}
		if($onlyCurrentUser) {
			if($this->zfcUserAuthentication()->hasIdentity()) {
				$identity = $this->zfcUserAuthentication()->getIdentity();
// 				$params['field'][] = 'user';
// 				$params['value'][] = sha1('neo' . $identity->getUserId() . 'bazaar');
				$params['field'][] = 'account';
				$params['value'][] = sha1('neo' . $identity->getUserId() . 'bazaar');
			} else {
				// Questo è necessario per non far restituire la lista completa se l'utente non è connesso
				$params['field'][] = 'account';
				$params['value'][] = sha1('usernotconnected');
			}
		}
		
		// 4) all classifieds? This should be requested only by the admin, will not use sphinx
		if((bool) $this->params()->fromQuery("full", false)) {
			if($this->zfcUserAuthentication()->hasIdentity()) {
			    $params = $this->params()->fromQuery();
				$identity = $this->zfcUserAuthentication()->getIdentity();
				$userModel = $this->getServiceLocator()->get('user.model.user');
				$userModel->init($identity, $this->getServiceLocator());
				if(!$userModel->getIsAdmin()) {
				    return new JsonModel(array());
				}
				
				$paginator = $this->getServiceLocator()->get('document.paginator.classifiedFull');
				$paginator->build($params);

				$data = array();
				foreach($paginator as $post) {
            		$file = $this->getServiceLocator()->get('document.model.classifiedAdminListing');
				    $data[] = $file->init($post);
				}

				$routeName = 'DocumentAdminClassified/page';
				$routeParams = array('page' => $this->params()->fromQuery("page", 1));
				$queryParams = array('full' => 1, 'user' => $this->params()->fromQuery("user"));
				$data = $this->getModel()->getPaginationData($this->getServiceLocator(), $paginator, $data, $routeName, $routeParams, $queryParams);

				return new JsonModel($data);
			}
		}
		
		// 5) Pass param to the model and get the data
		$data = $this->getModel()->getList($params, $this->getServiceLocator());
		
		return new JsonModel($data);
	}
933566
public function getList()
    {
        $routeMatch = $this->getEvent()->getRouteMatch();
        $mode = $routeMatch->getParam('mode', false);
        $annee = $routeMatch->getParam('annee', 0);
        $processStateHandler = $this->getProcessStateHandler();
        $processes = $processStateHandler->getRunningProcessList($mode, $annee);
        $response = $this->getResponse();
        $response->getHeaders()->addHeaderLine('Content-Type', 'application/json');
        $serializer = $this->getSerializer();
        $processJson = $serializer->serialize($processes, 'json');
        $response->setContent($processJson);
        return $response;
    }