Returns a place holder for pages that are new or when editing default page types.

@param string $handle

@return string
15799
public function getPlaceHolderText($handle)
    {
        $pageValues = $this->getAvailablePageValues();
        if (in_array($handle, array_keys($pageValues))) {
            $placeHolder = $pageValues[$handle];
        } else {
            $attributeKey = CollectionAttributeKey::getByHandle($handle);
            if (is_object($attributeKey)) {
                $placeHolder = $attributeKey->getAttributeKeyName();
            }
        }

        return "[" . $placeHolder . "]";
    }
31108
public static function getNeoBlockType($handle, $fieldId)
    {
        $neo = Craft::$app->plugins->getPlugin('neo');
        $blockTypes = $neo->blockTypes->getByFieldId($fieldId);
        foreach ($blockTypes as $block) {
            if ($block->handle == $handle) {
                return $block;
            }
        }

        return false;
    }
878399
public function getRule($handle)
    {
        $rules = $this->getRules();

        return isset($rules[$handle]) ? $rules[$handle] : null;
    }
1115325
public function description($handle = null)
    {
        if ($handle) {
            return $this->get($handle)->description;
        }

        return $this->setting->description;
    }
1280375
public function header($handle, $header)
    {
      if(!is_resource($handle))
        throw new Exception(__METHOD__ . '; cURL handle is not valid');

      $length = strlen($header);

      $this->headers .= $header;

      /*// Trim header (newline)
      $header = rtrim($header);

      if(strlen($header) > 0)
        $this->headers[] = $header;*/

      return $length;
    }
220458
private function getHandlerString($handler)
    {
        if (is_string($handler)) {
            return $handler;
        }

        if (is_object($handler) || $handler instanceof \Closure) {
            return spl_object_hash($handler);
        }

        if (is_array($handler) && is_callable($handler)) {
            return $this->getHandlerString($handler[0]) . '@' . $handler[1];
        }

        throw new RuntimeException('Can\'t convert handler to string.');
    }
835301
public static function create($handle, $name = '', $url = '')
    {
        $result = new static();
        $result->handle = (string) $handle;
        $result->name = (string) $name;
        $result->url = (string) $url;
        $result->latestVersion = null;
        $result->createdOn = new DateTime();

        return $result;
    }
580874
public function getThemeCustomizablePreset($handle)
    {
        $env = Environment::get();
        if ($this->isThemeCustomizable()) {
            $file = $env->getRecord(
                DIRNAME_THEMES.'/'.$this->getThemeHandle(
                ).'/'.DIRNAME_CSS.'/'.DIRNAME_STYLE_CUSTOMIZER_PRESETS.'/'.$handle.static::THEME_CUSTOMIZABLE_STYLESHEET_EXTENSION,
                $this->getPackageHandle()
            );
            if ($file->exists()) {
                $urlroot = $env->getURL(
                    DIRNAME_THEMES.'/'.$this->getThemeHandle().'/'.DIRNAME_CSS,
                    $this->getPackageHandle()
                );
                $preset = Preset::getFromFile($file->file, $urlroot);

                return $preset;
            }
        }
    }
149982
def get_or_create_placeholder(page, placeholder_slot, delete_existing=False):
    
    placeholder, created = page.placeholders.get_or_create(
        slot=placeholder_slot)
    if created:
        log.debug("Create placeholder %r for page %r", placeholder_slot,
                  page.get_title())
    else:
        log.debug("Use existing placeholder %r for page %r", placeholder_slot,
                  page.get_title())

    if delete_existing:
        queryset = CMSPlugin.objects.all().filter(placeholder=placeholder)
        log.info("Delete %i CMSPlugins on placeholder %s...", queryset.count(),
                 placeholder)
        queryset.delete()

    return placeholder, created
440896
protected function getNewHandle()
	{
		$handle = curl_init();
		curl_setopt($handle, CURLOPT_ENCODING,       '');
		curl_setopt($handle, CURLOPT_FAILONERROR,    true);
		curl_setopt($handle, CURLOPT_FOLLOWLOCATION, true);
		curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);

		return $handle;
	}
732246
public function fgetcsv($handle, $length = null, $delimiter = null, $enclosure = null)
    {
        return fgetcsv($handle, $length, $delimiter, $enclosure);
    }
621550
public function getByHandle($layoutId, $handle)
    {
        $record = NavigationRecord::findOne([
            'layoutId' => $layoutId,
            'handle'   => $handle,
        ]);

        if ($record) {
            return new NavigationModel($record->getAttributes());
        }

        return null;
    }
1240557
public function getProviderInfos($handle)
    {
        $record = $this->_getProviderRecordByHandle($handle);

        if($record)
        {
            return Oauth_ProviderInfosModel::populateModel($record);
        }
        else
        {
            $configProviderInfos = craft()->config->get('providerInfos', 'oauth');

            if(isset($configProviderInfos[$handle]))
            {
                $attributes = [];

                if(isset($configProviderInfos[$handle]['clientId']))
                {
                    $attributes['clientId'] = $configProviderInfos[$handle]['clientId'];
                }

                if(isset($configProviderInfos[$handle]['clientSecret']))
                {
                    $attributes['clientSecret'] = $configProviderInfos[$handle]['clientSecret'];
                }

                return Oauth_ProviderInfosModel::populateModel($attributes);
            }
        }
    }
1216218
def get_or_create_placeholder(self, page, placeholder_slot):
        
        placeholder, created = get_or_create_placeholder(
            page, placeholder_slot, delete_existing=self.delete_first)
        return placeholder, created
1056144
public function getPlaces($layoutSrc)
	{
		$places = array();

		// Ignore CDATA
		$cdataCallback = function($cdata) {};

		// Collect place holders
		$macroCallback = function($func, array $args) use (&$places, $layoutSrc) {
					if ($func == HtmlProcessor::PLACE_HOLDER) {
						if ( ! array_key_exists(0, $args) || $args[0] == '') {
							throw new \RuntimeException("No placeholder name defined in the placeHolder macro in file {$layoutSrc}");
						}

						// Normalize placeholder ID for case insensitive MySQL varchar field
						$places[] = mb_strtolower($args[0]);
					}
				};

		$this->walk($layoutSrc, $cdataCallback, $macroCallback);

		return $places;
	}
674320
protected function getAssoc($handle)
    {
        $oldSession = session_id();
        session_commit();
        session_id($handle);
        session_start();
        $assoc = null;
        if(!empty($_SESSION['assoc'])) {
            $assoc = $_SESSION['assoc'];
        }
        session_commit();
        if($oldSession) {
            session_id($oldSession);
            session_start();
        }
        return $assoc;
    }
623419
protected function enqueue_fallback_handle( $handle ) {
		$result = false;
		foreach ( $this->handlers as $handler ) {
			$result = $result || $handler->maybe_enqueue( $handle );
		}
		return $result;
	}