Load a single entity position.
TODO: Сделать эту функции в модуле site_commerce. Здесь не требуется подключение к БД.
485403
public function loadPosition($pid, $type) {
    // Get a site_commerce storage object.
    $site_commerce = \Drupal::entityTypeManager()->getStorage($type);

    // Load a single position.
    $position = $site_commerce->load($pid);

    return $position;
  }
166276
function load()
	{
		// vars
		$path = apply_filters('acf/get_info', 'path');
		
		
		// verify nonce
		if( isset($_POST['nonce']) && wp_verify_nonce($_POST['nonce'], 'export') )
		{
			if( isset($_POST['export_to_xml']) )
			{
				$this->action = 'export_to_xml';
			}
			elseif( isset($_POST['export_to_php']) )
			{
				$this->action = 'export_to_php';
			}
		}
		
		
		// include export action
		if( $this->action == 'export_to_xml' )
		{
			include_once($path . 'core/actions/export.php');
			die;
		}
	}
746489
def load(self):
        
        cl_tmp = self.api.list(self.objName, limit=self.searchLimit).values()
        cl = []
        for i in cl_tmp:
            cl.extend(i)
        return {x[self.index]: ItemPuppetClass(self.api, x['id'],
                                               self.objName, self.payloadObj,
                                               x)
                for x in cl}
36243
private function loadSitemapTree($entity)
	{
		$em = $this->getEntityManager();
		
		$input = $this->getRequestInput();
		$localeId = $this->getCurrentLocale()->getId();

		// Parent ID and level
		$levels = null;
		$parentId = null;
		
		if ($input->has('parent_id')) {
			$parentId = $input->get('parent_id');

			// Special case for root page, need to fetch 2 levels
			if (empty($parentId)) {
				$levels = 2;
			} else {
				$levels = 1;
			}
		} else {
			$levels = 2;
		}

		$parentLocalization = null;
		$filter = null;

		if ( ! empty($parentId)) {

			if (strpos($parentId, '_') !== false) {
				list($parentId, $filter) = explode('_', $parentId);
			}

			// Find localization, special case for group pages
			if ($entity == Page::CN()) {
				$parentLocalization = $em->find(PageLocalization::CN(), $parentId);

				if (is_null($parentLocalization)) {
					$rootNode = $em->find($entity, $parentId);

					if ($rootNode instanceof GroupPage) {
						$parentLocalization = $rootNode->getLocalization($localeId);
					}
				}
			} else {
				$parentLocalization = $em->find(TemplateLocalization::CN(), $parentId);
			}

			if (is_null($parentLocalization)) {
				throw new CmsException(null, 'The page the children has been requested for was not found');
			}
		}

		$response = $this->gatherChildrenData($entity, $parentLocalization, $filter, $levels);

		return $response;
	}
898024
def create_loadfile(entities, f):
        """"""
        with open(f, 'w') as out:
            out.write(Entity.create_payload(entities))
142588
def handle_entityref(self, entity):
        '''
            
        '''
        inTag = self._inTag
        if len(inTag) > 0:
            inTag[-1].appendText('&%s;' %(entity,))
        else:
            raise MultipleRootNodeException()
942814
public function getByPosition($position)
    {
        return isset($this->_entities[$position]) ? $this->_entities[$position] : null;
    }
1062638
private function loadFromCookies()
    {
        if ($this->items !== null)
        {
            return;
        }
        $this->items = array();

        if (isset($_COOKIE[$this->getName()]))
        {
            $cookieValue = $_COOKIE[$this->getName()];
            @$items = unserialize($cookieValue);

            /* Проверяем, прошла ли десериализация */
            if ($items === false)
            {
                Eresus_Kernel::log(__METHOD__, LOG_NOTICE, 'Cannot unserialize cookie value: "%s"',
                    $cookieValue);
                return;
            }

            // Записываем результат
            $this->items = $items;
        }
    }
927285
def load_page
      @page ||= Language.current.pages.contentpages.find_by(
        urlname: params[:urlname],
        language_code: params[:locale] || Language.current.code
      )
    end
1237914
private function load()
    {
        $this->cached = [];
        $entities = $this->daoGeneric->getEntities($this->entityName);
        foreach ($entities as $one) {
            $id = $one[ETypeBase::A_ID];
            $code = $one[ETypeBase::A_CODE];
            $this->cached[$code] = $id;
        }
    }
157428
def _start_from_base_entity(base_entity):
        
        return Node(
            type=base_entity.function,
            bel=base_entity.as_bel(),
            sha512=base_entity.sha512,
            data=json.dumps(base_entity),
        )
274261
public void load(HttpEntity entity, int maxBytes) throws IOException {

        contentType = null;
        Header type = entity.getContentType();
        if (type != null) {
            contentType = type.getValue();
        }

        contentEncoding = null;
        Header encoding = entity.getContentEncoding();
        if (encoding != null) {
            contentEncoding = encoding.getValue();
        }

        Charset charset;
        try {
            charset = ContentType.getOrDefault(entity).getCharset();
        } catch (Exception e) {
            logger.warn("parse charset failed: {}", e.getMessage());
            charset = Charset.forName("UTF-8");
        }

        if (charset != null) {
            contentCharset = charset.displayName();
        }

        contentData = toByteArray(entity, maxBytes);
    }
378193
def map_entity(self, entity: dal.AssetClass):
        
        obj = model.AssetClass()

        obj.id = entity.id
        obj.parent_id = entity.parentid
        obj.name = entity.name
        obj.allocation = entity.allocation
        obj.sort_order = entity.sortorder
        #entity.stock_links
        #entity.diff_adjustment
        if entity.parentid == None:
            obj.depth = 0

        return obj
171221
protected function loadStoreId() {
    $query = Drupal::entityQuery('commerce_store');
    $result = $query->execute();

    // There should only ever be one value returned so we naively use the first
    // item in the array. This should generally be safe as this should only run
    // within a Drupal site install context.
    $storeId = NULL;
    if (count($result) > 0) {
      $storeId = reset($result);
    }

    return $storeId;
  }
103073
def post(self, url, entity):
        

        try:
            if entity is None or entity == "":
                jsonData = ""
            else:
                jsonData = entity.to_json()
        except Exception as e:
            jsonData = jsonpickle.pickler.encode(entity)
        response = requests.post(
            self.host + url,
            jsonData,
            headers={
                "Content-Type": "application/json",
                'Authorization': 'Bearer ' + self.token,
                'x-falkonry-source':self.sourceHeader
            },
            verify=False
        )
        if response.status_code == 201:
            try:
                return json.loads(response._content.decode('utf-8'))
            except Exception as e:
                return json.loads(response.content)
        elif response.status_code == 409:
            try:
                return json.loads(response._content.decode('utf-8'))
            except Exception as e:
                return json.loads(response.content)
        elif response.status_code == 401:
            raise Exception(json.dumps({'message':'Unauthorized Access'}))
        else:
            raise Exception(response.content)
1362959
def get_entity(api, entity_id):
    
    response = utils.checked_api_call(api, 'get_specific', id=entity_id)
    if response:
        return response.content
    return
1246656
static synchronized <T extends Model> void load(T entity, Cursor cursor) {
		sAdapterHolder.getModelAdapter(entity.getClass()).load(entity, cursor);
	}