@see   PodsAPI::load_object

Load a Pod Template

$params['id'] int The template ID
$params['name'] string The template name

@param array $params An associative array of parameters

@return array|bool
@since 1.7.9
498530
public function load_template( $params ) {

		if ( ! class_exists( 'Pods_Templates' ) ) {
			return false;
		}

		$params       = (object) $params;
		$params->type = 'template';

		return $this->load_object( $params );
	}
885692
public static function open($params = array()) {

        if( !is_array($params) )
        {
            throw new \InvalidArgumentException("Arguments is not a Array". print_r($params, true));
        }
        $o = '<form';
        $o .= (isset($params['id'])) ? " id='{$params['id']}'" : '';
        $o .= (isset($params['name'])) ? " name='{$params['name']}'" : '';
        $o .= (isset($params['class'])) ? " class='{$params['class']}'" : '';
        $o .= (isset($params['onsubmit'])) ? " onsubmit='{$params['onsubmit']}'" : '';
        $o .= (isset($params['method'])) ? " method='{$params['method']}'" : ' method="get"';
        $o .= (isset($params['action'])) ? " action='{$params['action']}'" : '';
        $o .= (isset($params['files'])) ? " enctype='multipart/form-data'" : '';
        $o .= (isset($params['style'])) ? " style='{$params['style']}'" : '';
        $o .= (isset($params['role'])) ? " role='{$params['role']}'" : '';
        $o .= (isset($params['autocomplete'])) ? " autocomplete='{$params['autocomplete']}'" : '';
        $o .= '>';
        return $o . "\n";
    }
221137
public function get(array $params = [])
    {
        $this->getLogger()->info('Getting list of layouts ');
        $entries = [];
        $hydratedRegions = [];
        $hydratedWidgets = [];
        $response = $this->doGet($this->url, $params);
        if (isset($params['embed']))
            $embed = ($params['embed'] != null) ? explode(',', $params['embed']) : [];

        foreach ($response as $item) {
            /** @var XiboLayout $layout */
            $layout = new XiboLayout($this->getEntityProvider());
            $layout->hydrate($item);
            foreach ($layout->regions as $reg) {
                /** @var XiboRegion $region */
                $region = new XiboRegion($this->getEntityProvider());
                $region->hydrate($reg);
                if (in_array('playlists', $embed) === true) {
                    /** @var XiboPlaylist $playlist */
                    $playlist = new XiboPlaylist($this->getEntityProvider());
                    $playlist->hydrate($reg['regionPlaylist']);
                    foreach ($playlist->widgets as $widget) {
                        /** @var XiboWidget $widgetObject */
                        $widgetObject = new XiboWidget($this->getEntityProvider());
                        $widgetObject->hydrate($widget);
                        $hydratedWidgets[] = $widgetObject;
                    }
                    $playlist->widgets = $hydratedWidgets;
                    $region->regionPlaylist = $playlist;
                }
                // Add to parent object
                $hydratedRegions[] = $region;
            }
            $layout->regions = $hydratedRegions;

            $entries[] = clone $layout;
        }

        return $entries;
    }
160066
protected function serializeParams(array $params)
    {
        $serialized = array();
        foreach ($params as $param) {
            $serialized[] = $this->serializer->serialize($param);
        }

        return $serialized;
    }
282698
public function load($resourceType, $name, $params = [])
    {
        return $this->client()->get('custom-fields/{resourceType}/{name}', [
                'resourceType' => $resourceType,
                'name' => $name,
            ] + (array) $params);
    }
447654
public function itemsProcFunc(array &$params)
    {
        $this->init();
        if ($params['row']['pid'] > 0) {
            $contentType = is_array($params['row']['CType']) ? $params['row']['CType'][0] : $params['row']['CType'];
            $listType = is_array($params['row']['list_type']) ? $params['row']['list_type'][0] : $params['row']['list_type'];
            $gridType = is_array($params['row']['tx_gridelements_backend_layout']) ? $params['row']['tx_gridelements_backend_layout'][0] : $params['row']['tx_gridelements_backend_layout'];
            $params['items'] = $this->addColPosListLayoutItems(
                $params['row']['pid'],
                $params['items'],
                $contentType,
                $listType,
                $gridType,
                $params['row']['tx_gridelements_container']
            );
        } else {
            // negative uid_pid values indicate that the element has been inserted after an existing element
            // so there is no pid to get the backendLayout for and we have to get that first
            $existingElement = BackendUtility::getRecordWSOL(
                'tt_content',
                -((int)$params['row']['pid']),
                'pid,CType,tx_gridelements_container'
            );
            if ($existingElement['pid'] > 0) {
                $params['items'] = $this->addColPosListLayoutItems(
                    $existingElement['pid'],
                    $params['items'],
                    $existingElement['CType'],
                    $existingElement['list_type'],
                    $existingElement['tx_gridelements_backend_layout'],
                    $existingElement['tx_gridelements_container']
                );
            }
        }
    }
75743
public function ajax( $params ) {

		if ( ! isset( $params->step ) ) {
			return pods_error( __( 'Invalid upgrade process.', 'pods' ) );
		}

		if ( ! isset( $params->type ) ) {
			return pods_error( __( 'Invalid upgrade method.', 'pods' ) );
		}

		if ( ! method_exists( $this, $params->step . '_' . $params->type ) ) {
			return pods_error( __( 'Upgrade method not found.', 'pods' ) );
		}

		return call_user_func( array( $this, $params->step . '_' . $params->type ), $params );
	}
720496
public function load($id, array $parameters = [], array $headers = [])
    {
        return $this->loadCollection($parameters, $headers)->filterId($id);
    }
547986
public function ajax_add( $params ) {

		global $wp_roles;

		$role_name  = pods_var_raw( 'role_name', $params );
		$role_label = pods_var_raw( 'role_label', $params );

		$params->capabilities = (array) pods_var_raw( 'capabilities', $params, array() );

		$params->custom_capabilities = (array) pods_var_raw( 'custom_capabilities', $params, array() );
		$params->custom_capabilities = array_filter( array_unique( $params->custom_capabilities ) );

		$capabilities = array();

		foreach ( $params->capabilities as $capability => $x ) {
			if ( empty( $capability ) || true !== (boolean) $x ) {
				continue;
			}

			$capabilities[ esc_attr( $capability ) ] = true;
		}

		foreach ( $params->custom_capabilities as $x => $capability ) {
			if ( empty( $capability ) || '--1' === $x ) {
				continue;
			}

			$capabilities[ esc_attr( $capability ) ] = true;
		}

		if ( empty( $role_name ) ) {
			return pods_error( __( 'Role name is required', 'pods' ) );
		}

		if ( empty( $role_label ) ) {
			return pods_error( __( 'Role label is required', 'pods' ) );
		}

		return add_role( $role_name, $role_label, $capabilities );
	}
351270
public function renderString($template, array $params = null)
    {
        if (! empty($params)) {
            $this->assign($params);
        }

        $compiled = $this->getCompiler()->compile($template);

        $tempFile = tempnam(sys_get_temp_dir(), __FUNCTION__);

        $this->writeToFile($tempFile, $compiled);

        $template = $this->readBuffer($tempFile);

        unlink($tempFile);

        return $template;
    }
248948
private function loadConfiguration($params)
	{
		if (!is_null(self::$jConfig))
		{
			return true;
		}

		// Load config as object
		$jConfig = json_decode(json_encode(parse_ini_file(JPATH_BASE . '/jorobo.ini', true)), false);

		if (!$jConfig)
		{
			$this->say('Error: Config file jorobo.ini not available');

			throw new FileNotFoundException('Config file jorobo.ini not available');
		}

		// Are we building a git / dev release?
		if ($this->isDevelopmentVersion($params))
		{
			$res = $this->_exec('git rev-parse --short HEAD');

			$version = "git" . trim($res->getMessage());

			if ($version)
			{
				$this->say("Changing version to development version " . $version);
				$jConfig->version = $version;
			}
		}

		$jConfig->buildFolder = JPATH_BASE . $this->determineTarget($jConfig);
		$jConfig->params      = $params;

		self::$jConfig = $jConfig;

		// Date set
		date_default_timezone_set('UTC');
	}
546754
public static function load($param) {
        global $DB;
        if (is_object($param)) {
            $event = new calendar_event($param);
        } else {
            $event = $DB->get_record('event', array('id' => (int)$param), '*', MUST_EXIST);
            $event = new calendar_event($event);
        }
        return $event;
    }
559333
private function request(RequestParams $params)
    {
        /*
         * Build Resource URI
         */
        $rm = $params->resourceMetadata;
        $base = $this->config['base_url'] . $this->config['api_path'] . "/";

        if (!empty($params->appId)) {
            $url = $base . 'General/Apps/' . $params->appId . '/callBackend';
        } else {
            $url = $base . $rm->product . '/' . $rm->resource;
        }

        if (!empty($params->id)) {
            $url .= '/' . $params->id;
        }

        if (!empty($params->action)) {
            $url .= '/' . $params->action;
        }

        if (!empty($params->actionArg)) {
            $url .= '/' . $params->actionArg;
        }

        $options = array_merge(['auth' => 'oauth'], $params->options);

        if (!array_key_exists(\GuzzleHttp\RequestOptions::HEADERS, $options)) {
            $options[\GuzzleHttp\RequestOptions::HEADERS] = [];
        }

        /*
         * Result filtering, sorting & searching
         */
        $p = [];
        if (!empty($params->searchParams->query)) {
            $q = $params->searchParams->query;

            if (!empty($q->count)) {
                $p['count'] = $q->count;
            }

            if (!empty($q->offset)) {
                $p['offset'] = $q->offset;
            }

            if (!empty($q->query)) {
                $p['q'] = $q->query;
            }

            if (!empty($q->fields)) {
                $p['fields'] = implode(',', $q->fields);
            }

            if (!empty($q->sortOrder)) {
                foreach ($q->sortOrder as $key => $value) {
                    $p['sort[' . $key . ']'] = $value;
                }
            }
        }

        if (!empty($params->searchParams->scrollId)) {
            $p['scroll_id'] = $params->searchParams->scrollId;
        }

        if (!empty($params->searchParams->scrollExpire)) {
            $p['scroll_expire'] = $params->searchParams->scrollExpire;
        }

        if (count($p) != 0) {
            $options[\GuzzleHttp\RequestOptions::QUERY] = $p;
        }

        /*
         * JSON Body
         */

        if (!empty($params->jsonData)) {
            $options[\GuzzleHttp\RequestOptions::BODY] = $params->jsonData;
            $options[\GuzzleHttp\RequestOptions::HEADERS]['Content-Type'] = 'application/json';
        }

        /*
         * Idempotence (avoid double execution of the same request)
         */
        if ($this->actionId !== null) {
            $options[\GuzzleHttp\RequestOptions::HEADERS]['X-Action'] = $this->actionId;
            $this->setActionId(null);
        }

        /*
         * Run request
         */
        try {
            $response = $this->httpClient->request($params->operation, $url, $options);
        } catch (Exception $e) {
            throw $this->mapError($e, 'Error sending API request.');
        }

        if ($response->getStatusCode() == 200) {
            return MapperUtil::mapResponse($response);
        }

        return false;
    }
1015319
public function findByParams($params = [])
    {
        $query = $this->paramsToQuery($params);

        return $this->findByQuery($query, $params);
    }
53451
protected final void loadQueryString(Map<String, String[]> params) {
        for (Map.Entry<String, String[]> param : params.entrySet()) {
            loadKeys(param.getKey(), param.getValue());
        }
    }
734899
public function findUser(array $params)
    {
        /** @var UserProvider $userProvider */
        $userProvider = $this->container[UserProvider::class];
        try {
            /** @var User $user */
            $user = $userProvider->loadUserByUsername($params['username']);
        } catch(\Exception $e) {
            return false;
        }
        return $user;
    }
1211985
def load_template(self, name, *parameters):
        
        template, fields, header_fields = self._set_templates_fields_and_header_fields(name, parameters)
        self._init_new_message_stack(template, fields, header_fields)