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

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

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

		return $this->reportXLinkResourceTypeError( "3.5.3.8.1", $linkbase, $value );
	}
382377
public function hasAllowedType($value)
    {
        if (!$this->forceType) {
            return true;
        }

        return Type::is($value, $this->forceType);
    }
775882
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        return ($this->serializer)($value, $this->name, $platform);
    }
619348
public function setAttribute($key, $value)
    {
        if ($this->isBaseAttribute($key))
        {
            return parent::setAttribute($key, $value);
        } else
        {
            return $this->getSource()->setAttribute($key, $value);
        }
    }
519676
static public function isBaseTypeCompliant($baseType, $value)
    {
        if ($value === null) {
            return true; // A value can always be null.
        } elseif ($value instanceof QtiDatatype && $baseType === $value->getBaseType()) {
            return true;
        } else {
            return false;
        }
    }
334435
private function validateLocator( $xlinkAttributes, $linkbaseName, $locatorParts, $linkbaseUrl )
	{
		$result = true;

		// $href = (string) $xlinkAttributes->href;
		// $parts = parse_url( $href );
		if ( ! isset( $locatorParts['path'] ) )
		{
			if ( ! isset( $locatorParts['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( $linkbaseUrl ) ][ trim( $locatorParts['fragment'], '#' ) ] );
			return $result;
		}

		if ( XBRL::endsWith( $locatorParts['path'], '.xml' ) )
		{
			// //BMS 2018-05-04 Dont think this is necessary.  Copied to retrieveLocator for now
			// // It's a linkbase reference
			// if ( isset( $this->linkbaseIds[ basename( $locatorParts['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, $locatorParts['path'] ),
			// 	'role' => XBRL_Constants::$anyLinkbaseRef,
			// 	'arcrole' => \XBRL_Constants::$arcRoleLinkbase,
			// 	'title' => '',
			// 	'base' => '',
			// );
            //
			// $this->processPresentationLinkbase( $linkbaseRef );
			// $this->processLabelLinkbase( $linkbaseRef );
			// $this->processDefinitionLinkbase( $linkbaseRef );
			// $this->processCalculationLinkbase( $linkbaseRef );
			// $this->processReferenceLinkbase( $linkbaseRef );
			// // Handle custom linkbases
			// $this->processCustomLinkbaseArcRoles( $linkbaseRef );

			return true;
		}

		/**
		 * @var XBRL $taxonomy
		 */
		$taxonomy = basename( $locatorParts['path'] ) == $this->getTaxonomyXSD()
			? $this
			// BMS 2019-01-26 Changed to explicity use the basename as getTaxonomyForXSD no longer will
			: $this->getTaxonomyForXSD( basename( $locatorParts['path'] ) );

		if ( ! $taxonomy )
		{
			// If the linkbase is 'labelLink' look in the labels
			if ( $linkbaseName == 'labelLink' )
			{
				$labelsHref =& $this->context->labels[ XBRL_Constants::$defaultLinkRole ]['labelshref'];
				if ( ! isset( $labelsHref[ basename( $locatorParts['path'] ) ] ) ||
					 ! isset( $labelsHref[ basename( $locatorParts['path'] ) ][ $locatorParts['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 ( empty( $locatorParts['fragment'] ) )
		{
			return $result;
		}

		if ( $taxonomy )
		{
			// BMS 2018-04-16	This is required by the XBRL 2.1 specification (see test 2012 V-02)
			$element =& $taxonomy->getElementById( $locatorParts['fragment'] );
			if ( ! $element &&
				 ! isset( $taxonomy->roleTypeIds[ $locatorParts['fragment'] ] ) &&
				 ! isset( $taxonomy->arcroleTypeIds[ $locatorParts['fragment'] ] ) &&
				 ! $taxonomy->context->types->getTypeById( $locatorParts['fragment'], $taxonomy->getPrefix() )
			)
			{

				$this->log()->taxonomy_validation( "3.5.3.9.2", "The id of the locator does not exist in the DTS",
					array(
						'href' => basename( $linkbaseUrl ),
						'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' => $locatorParts['path'],
					'linkbase' => $linkbaseName,
				)
			);
			$result = false;
		}

		return $result;
	}
1343103
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if (empty($value)) {
            return null;
        }

        if (
            $value instanceof UuidInterface
            || (
                (is_string($value) || method_exists($value, '__toString'))
                && Uuid::isValid((string) $value)
            )
        ) {
            return (string) $value;
        }

        throw ConversionException::conversionFailed($value, static::NAME);
    }
71064
public function convertToDatabaseValueSQL($value, AbstractPlatform $platform)
    {
        if (null === $value || '' === $value) {
            $value = null;
        }

        return $this->getSqlType()->convertToDatabaseValueSQL($value, $platform);
    }
1062089
@XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "link", scope = SourceType.class)
    public JAXBElement<LinkType> createSourceTypeLink(LinkType value) {
        return new JAXBElement<LinkType>(ENTRY_TYPE_LINK_QNAME, LinkType.class,
                SourceType.class, value);
    }
1163776
public function setCoreUseWeblinkTarget($value)
    {
        $this->setFieldName('use_weblink_target');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
295480
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if ($value instanceof Date) {
            return $value->toDateTime()->format($platform->getDateFormatString());
        }
        return parent::convertToDatabaseValue($value, $platform);
    }
680494
public function attachResource(core_kernel_classes_Property $targetProperty, core_kernel_classes_Resource $targetResource, $value)
    {
        // We have to check if the resource identified by value exists in the Ontology.
        $resource = new core_kernel_classes_Resource($value);
        if ($resource->exists()) {
            // Is the range correct ?
            $targetPropertyRanges = $targetProperty->getPropertyValuesCollection(new core_kernel_classes_Property(OntologyRdfs::RDFS_RANGE));
            $rangeCompliance = false;

            // If $targetPropertyRange->count = 0, we consider that the resouce
            // may be attached because $rangeCompliance = true.
            foreach ($targetPropertyRanges->getIterator() as $range) {
                // Check all classes in target property's range.
                if ($resource->hasType(new core_kernel_classes_Class($range))) {
                    $rangeCompliance = true;
                    break;
                }

            }

            if (true == $rangeCompliance) {
                $targetResource->setPropertyValue($targetProperty, $resource->getUri());
            }
        }
    }
971047
private function reportNoRoleLinks( $linkbaseRef, $linkbase )
	{
		$xml_basename = basename( $linkbaseRef['href'] );

		$this->log()->taxonomy_validation( "4.3.3", "The content of the linkbase file does not match the role specified",
			array(
				'url' => "'$xml_basename'",
				'role' => "'{$linkbaseRef['role']}'",
				'link type' => $linkbase,
			)
		);
		return false;
	}
663814
protected function checkType($value, $type, $nullable = false)
    {
        if (gettype($value) === $type) {
            return true;
        }
        return $nullable && null === $value;
    }
1085462
public function convertToDatabaseValue($value, AbstractPlatform $platform) : ?string
    {
        if ($value instanceof DateTime) {
            $value->setTimezone($this->getUtc());
        }

        return parent::convertToDatabaseValue($value, $platform);
    }
79572
public function getLinkbase( $linkbaseName )
	{
		return isset( $this->linkbases[ basename( $linkbaseName ) ] )
			? $this->linkbases[ basename( $linkbaseName ) ]
			: null;
	}
814747
public function resolveLinks($value)
    {
        if (is_array($value)) {
            return array_map([$this, 'resolveLinks'], $value);
        }

        if (is_string($value) && strpos($value, '{@') !== false) {
            $value = $this->resolveLinksInString($value);
        }

        return $value;
    }