A locator MUST have a type and its value MUST be 'locator'

@param string $linkbase
@param string $value  The value of the type
@return boolean
542425
private function validateXLinkLocatorType( $linkbase, $value )
	{
		if ( ! XBRL::isValidating() ) return true;

		if ( $value == 'locator' ) return true;

		return $this->reportXLinkLocatorTypeError( "3.5.3.7.1", $linkbase, $value );
	}
485665
protected function databaseValue($value)
    {
        if (is_string($value)) {
            return $value;
        }

        if (!$value instanceof BinaryValue) {
            if (!is_resource($value) && !$value instanceof StreamInterface) {
                throw ODMException::invalidValueForType('Binary', ['string', 'resource', 'StreamInterface', 'BinaryValue', 'null'], $value);
            }

            $value = \GuzzleHttp\Psr7\stream_for($value);
        }

        return (string)$value;
    }
1051374
public static function set($key, $value)
    {
        $segements = dot($key);

        if (count($segements) == 2) {
            self::$links[$segements[0]][$segements[1]] = $value;
        } else {
            exception(LogicException::class, 'The link surface doesn\'t support many indexes');
        }
    }
579997
public function prepareAttributeValue($mapping, $value)
    {
        if ($value === null) {
            return Type::getNull();
        }

        $type = $mapping !== null ? $mapping->getType() : TypeFactory::getTypeFromPHPVariable($value);

        if (is_array($value)) {
            $value = array_map(
                function ($v) {
                    $this->prepareAttributeValue(null, $v);
                },
                $value
            );
        }

        return $type->convertToDatabaseValue($value);
    }
572865
public function geetParamTypeByValue($value)
	{
		switch(gettype($value))
		{
			case 'boolean':
				return PDO::PARAM_BOOL;
				break;
			case 'integer':
				return PDO::PARAM_INT;
				break;
			case 'NULL':
				return PDO::PARAM_NULL;
				break;
			default:
				return PDO::PARAM_STR;
				break;
		}
	}
981248
protected function checkValueStructure(BaseValue $value)
    {
        if (null !== $value->link && !is_string($value->link)) {
            throw new InvalidArgumentType(
                '$value->link',
                'string',
                $value->link
            );
        }

        if (null !== $value->text && !is_string($value->text)) {
            throw new InvalidArgumentType(
                '$value->text',
                'string',
                $value->text
            );
        }
    }
295480
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if ($value instanceof Date) {
            return $value->toDateTime()->format($platform->getDateFormatString());
        }
        return parent::convertToDatabaseValue($value, $platform);
    }
293454
public function convertToDatabaseValue($value, AbstractPlatform $platform)
	{
		if (is_null($value)) {
			return null;
		}
		
		$string = $value->getFullPath();
		
		return $string;
	}
1063150
protected function _createLink($value, $pagingString = null)
    {
        if ($pagingString !=null ) {
            $link = $this->RequestContext->getSite()->getBaseURL().preg_replace("/\/[\/]+/", "/", ltrim($pagingString.'/'.$value.'/'));
            if($this->getLocal('UseQueryStringInCacheKey') != null)
                $link .= ($this->Request->getQueryString() != ""?"?".$this->Request->getQueryString():"");
            return $link;
        } else {
            return URLUtils::appendQueryString($this->Request->getFullURL(), array('view_page'=> $value));
        }
    }
618051
protected static function getLookupIterator($value)
    {
        return is_callable($value) ? $value : function ($object) use ($value) {
            return static::get($object, $value);
        };
    }
895135
private function validateXLinkLocatorAttributes( $xlinkAttributes, $linkbaseName, $linkbaseHRef )
	{
		if ( ! XBRL::isValidating() ) return true;

		$result = true;

		if ( ! property_exists( $xlinkAttributes, 'type' ) )
		{
			$this->reportMissingLocatorAttribute( '3.5.3.7.1', 'type', $linkbaseName );
			$result = false;
		}

		if ( ! property_exists( $xlinkAttributes, 'label' ) )
		{
			$this->reportMissingLocatorAttribute( '3.5.3.7.3', 'label', $linkbaseName );
			$result = false;
		}

		if ( ! property_exists( $xlinkAttributes, 'href' ) )
		{
			$this->reportMissingLocatorAttribute( '3.5.3.7.2', 'href', $linkbaseName );
			return false;
		}

		// BMS 2018-04-16 This have been moved to a function called 'validateLocator'
		// $href = (string) $xlinkAttributes->href;
		// $parts = parse_url( $href );
		// if ( ! isset( $parts['path'] ) )
		// {
		// 	if ( ! isset( $parts['fragment'] ) )
		// 	{
		// 		$this->log()->taxonomy_validation( "3.5.3.7.2", "The href of the locator is not valid",
		// 			array(
		// 				'linkbase' => $linkbaseName,
		// 				'href' => $href,
		// 			)
		// 		);
        //
		// 		return false;
		// 	}
        //
		// 	// The locator points to a reference that has already been loaded.  Just check that it has.
		// 	$result = isset( $this->linkbaseIds[ basename( $linkbaseHRef ) ][ trim( $parts['fragment'], '#' ) ] );
		// 	return $result;
		// }
        //
		// if ( XBRL::endsWith( $parts['path'], '.xml' ) )
		// {
		// 	// It's a linkbase reference
		// 	if ( isset( $this->linkbaseIds[ $parts['path'] ] ) )
		// 	{
		// 		return true;
		// 	}
        //
		// 	$linkbaseRef = array(
		// 		'type' => (string) $xlinkAttributes->type,
		// 		// BMS 2017-10-27 This makes the linkbase relative to the location of the schema file which is not correct
		// 		// 'href' => XBRL::resolve_path( $taxonomy->getSchemaLocation(), $href ),
		// 		'href' => XBRL::resolve_path( $this->schemaLocation, $parts['path'] ),
		// 		'role' => XBRL_Constants::$anyLinkbaseRef,
		// 		'arcrole' => \XBRL_Constants::$arcRoleLinkbase,
		// 		'title' => '',
		// 		'base' => '',
		// 	);
        //
		// 	$this->processPresentationLinkbase( $linkbaseRef );
		// 	$this->processLabelLinkbase( $linkbaseRef );
		// 	$this->processDefinitionLinkbase( $linkbaseRef );
		// 	$this->processCalculationLinkbase( $linkbaseRef );
		// 	// Handle custom linkbases
		// 	$this->processCustomLinkbaseArcRoles( $linkbaseRef );
        //
		// 	return true;
		// }
        //
		// /**
		//  * @var XBRL $taxonomy
		//  */
		// $taxonomy = $parts['path'] == $this->getTaxonomyXSD()
		// 	? $this
		// 	: $this->getTaxonomyForXSD( $parts['path'] );
        //
		// if ( ! $taxonomy )
		// {
		// 	// If the linkbase is 'label' look in the labels
		// 	if ( $linkbaseName == 'labels' )
		// 	{
		// 		$labelsHref =& $this->context->labels[ XBRL_Constants::$defaultLinkRole ]['labelshref'];
		// 		if ( ! isset( $labelsHref[ basename( $parts['path'] ) ] ) ||
		// 			 ! isset( $labelsHref[ basename( $parts['path'] ) ][ $parts['fragment'] ] ) )
		// 		{
		// 			$result = false;
		// 		}
		// 	}
		// 	else
		// 	{
		// 		// Look for the taxonomy and include its contents in the DTS
		// 		$xsd = $this->resolve_path( $this->getSchemaLocation(), $href );
		// 		$xsd = strpos( $xsd, '#' ) ? strstr( $xsd, '#', true ) : $xsd;
        //
		// 		$taxonomy = XBRL::withTaxonomy( $xsd );
		// 		// $taxonomy = $this->getTaxonomyForXSD( $xsd );
		// 	}
		// }
        //
		// if ( $taxonomy )
		// {
		// 	// BMS 2018-04-16	This is required by the XBRL 2.1 specification (see test 2012 V-02)
		// 	$element =& $taxonomy->getElementById( $parts['fragment'] );
		// 	if ( ! $element )
		// 	{
		// 		$this->log()->taxonomy_validation( "3.5.3.9.2", "The concept of the locator does not exist in the DTS",
		// 			array(
		// 				'href' => $href,
		// 				'linkbase' => $linkbaseName,
		// 			)
		// 		);
		// 		$result = false;
		// 	}
		// }
		// else
		// {
		// 	$this->log()->taxonomy_validation( "3.5.3.7.2", "The document of the locator does not exist in the DTS",
		// 		array(
		// 			'href' => $href,
		// 			'linkbase' => $linkbaseName,
		// 		)
		// 	);
		// 	$result = false;
		// }

		return $result;
	}
517264
static public function inferBaseType($value)
    {
        if ($value === null) {
            return false;
        } elseif ($value instanceof RecordContainer) {
            return false;
        } elseif ($value instanceof QtiDatatype) {
            return $value->getBaseType();
        } else {
            return false;
        }
    }
785545
private function reportXLinkTypeError( $section, $message, $linkbase, $value )
	{
		$this->log()->taxonomy_validation( $section, $message,
			array(
				'linkbase' => $linkbase,
				'value' => $value,
			)
		);

		return false;
	}
663814
protected function checkType($value, $type, $nullable = false)
    {
        if (gettype($value) === $type) {
            return true;
        }
        return $nullable && null === $value;
    }
37544
public static function mustBeNullableString($value)
    {
        if (is_string($value) === false && $value != null) {
            throw new MWrongTypeException('\$value', 'string|null', gettype($value));
        }
    }
142975
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if ($value instanceof \DateTime) {
            $value->setTimezone($this->getDateTimezone());
        }

        return parent::convertToDatabaseValue($value, $platform);
    }
1323094
public function link($name, $value, $action = 'add')
    {
        $method_name = $action.'LinkAttribute';
        $this->$method_name($name, $value);

        return $this;
    }