コード例 #1
0
function filterAttributeValues( RecordSet $sourceRecordSet, Attribute $attributeAttribute, array &$attributeIds ) {
	$result = new ArrayRecordSet( $sourceRecordSet->getStructure(), $sourceRecordSet->getKey() );
	$i = 0;
	
	while ( $i < $sourceRecordSet->getRecordCount() ) {
		$record = $sourceRecordSet->getRecord( $i );
		
		if ( in_array( $record->getAttributeValue( $attributeAttribute )->definedMeaningId, $attributeIds ) ) {
			$result->add( $record );
			$sourceRecordSet->remove( $i );
		}
		else
			$i++;
	}
	
	return $result;
}
コード例 #2
0
	public function viewRows( IdStack $idPath, RecordSet $value, Structure $visibleStructure ) {
		$result = "";
		$rowAttributes = $this->getRowAttributesText();
		$key = $value->getKey();
		$recordCount = $value->getRecordCount();

		for ( $i = 0; $i < $recordCount; $i++ ) {
			$record = $value->getRecord( $i );
			$idPath->pushKey( project( $record, $key ) );
			$result .=
				'<tr id="' . $idPath->getId() . '" ' .  $rowAttributes . '>' .
					getRecordAsTableCells( $idPath, $this, $visibleStructure, $record ) .
				'</tr>' . EOL;
				
			$idPath->popKey();
		}
		
		return $result;
	}