Formulas/Resources/Filters/Boolean.php
public function validate( $variableSet, $nsMgr )
	{
		$arcs = $variableSet->xbrlTaxonomy->getGenericArc( \XBRL_Constants::$arcRoleBooleanFilter, $this->linkRoleUri, $this->label, $this->path );

		/**
		 * @var array[Filter] $filters
		 */
		$filters = array();

		foreach ( $arcs as $arc )
		{
			// BMS 2019-02-11
			if ( $this->path != $arc['frompath'] ) continue;

			$variableSet->xbrlTaxonomy->getGenericResource( 'filter', null, function( $roleUri, $linkbase, $variableSetName, $index, $resource ) use( &$filters, $arc )
			{
				// if ( $resource['label'] != $arc['to'] ) return true;
				if ( $resource['path'] != $arc['topath'] /* || $linkbase != $arc['linkbase'] */ ) return true;

				if ( $arc['attributes'] )
				{
					foreach ( $arc['attributes'] as $name => $attribute )
					{
						$value = $attribute['type'] == "xs:boolean"
							? (bool)$attribute['value']
							: $attribute['value'];
						$resource[ $name ] = $value;
					}
				}

				$filterResources[] = $resource;
				$className = __NAMESPACE__ . '\\' . ucfirst( $resource['filterType'] );
				$filters[] = $className::fromArray( $resource );

				return true;
			}, $arc['toRoleUri'], $arc['to'], $arc['tolinkbase'] );
		}

		foreach ( $filters as $filter )
		{
			if ( ! $filter->validate( $variableSet, $nsMgr ) )
			{
				return false;
			}
		}

		$this->filters = $filters;

		return true;
	}
public function validate( $variableSet, $nsMgr )
	{
		$arcs = $variableSet->xbrlTaxonomy->getGenericArc( \XBRL_Constants::$arcRoleBooleanFilter, $this->linkRoleUri, $this->label, $this->path );

		/**
		 * @var array[Filter] $filters
		 */
		$filters = array();

		foreach ( $arcs as $arc )
		{
			// BMS 2019-02-11
			if ( $this->path != $arc['frompath'] ) continue;

			$variableSet->xbrlTaxonomy->getGenericResource( 'filter', null, function( $roleUri, $linkbase, $variableSetName, $index, $resource ) use( &$filters, $arc )
			{
				// if ( $resource['label'] != $arc['to'] ) return true;
				if ( $resource['path'] != $arc['topath'] /* || $linkbase != $arc['linkbase'] */ ) return true;

				if ( $arc['attributes'] )
				{
					foreach ( $arc['attributes'] as $name => $attribute )
					{
						$value = $attribute['type'] == "xs:boolean"
							? (bool)$attribute['value']
							: $attribute['value'];
						$resource[ $name ] = $value;
					}
				}

				$filterResources[] = $resource;
				$className = __NAMESPACE__ . '\\' . ucfirst( $resource['filterType'] );
				$filters[] = $className::fromArray( $resource );

				return true;
			}, $arc['toRoleUri'], $arc['to'], $arc['tolinkbase'] );
		}

		foreach ( $filters as $filter )
		{
			if ( ! $filter->validate( $variableSet, $nsMgr ) )
			{
				return false;
			}
		}

		$this->filters = $filters;

		return true;
	}
public function validate ( $ variableSet , $ nsMgr ) { $ arcs = $ variableSet -> xbrlTaxonomy -> getGenericArc ( \ XBRL_Constants :: $ arcRoleBooleanFilter , $ this -> linkRoleUri , $ this -> label , $ this -> path ) ; /**
		 * @var array[Filter] $filters
		 */ $ filters = array ( ) ; foreach ( $ arcs as $ arc ) { // BMS 2019-02-11
 if ( $ this -> path != $ arc [ 'frompath' ] ) continue ; $ variableSet -> xbrlTaxonomy -> getGenericResource ( 'filter' , null , function ( $ roleUri , $ linkbase , $ variableSetName , $ index , $ resource ) use ( & $ filters , $ arc ) { // if ( $resource['label'] != $arc['to'] ) return true;
 if ( $ resource [ 'path' ] != $ arc [ 'topath' ] /* || $linkbase != $arc['linkbase'] */ ) return true ; if ( $ arc [ 'attributes' ] ) { foreach ( $ arc [ 'attributes' ] as $ name => $ attribute ) { $ value = $ attribute [ 'type' ] == "xs:boolean" ? ( bool ) $ attribute [ 'value' ] : $ attribute [ 'value' ] ; $ resource [ $ name ] = $ value ; } } $ filterResources [ ] = $ resource ; $ className = __NAMESPACE__ . '\\' . ucfirst ( $ resource [ 'filterType' ] ) ; $ filters [ ] = $ className :: fromArray ( $ resource ) ; return true ; } , $ arc [ 'toRoleUri' ] , $ arc [ 'to' ] , $ arc [ 'tolinkbase' ] ) ; } foreach ( $ filters as $ filter ) { if ( ! $ filter -> validate ( $ variableSet , $ nsMgr ) ) { return false ; } } $ this -> filters = $ filters ; return true ; }
Validate that there are filters for this boolean
@param VariableSet $variableSet
@param XmlNamespaceManager $nsMgr
@return bool
Validate that there are filters for this boolean