Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
XML_Query2XML::getXML(): asterisk shortcut with attributes - supressing single attribute using "condition"
3
--SKIPIF--
4
<?php require_once dirname(dirname(__FILE__)) . '/skipif.php'; ?>
5
--FILE--
6
<?php
7
    require_once 'XML/Query2XML.php';
8
    require_once dirname(dirname(__FILE__)) . '/db_init.php';
9
    $query2xml =& XML_Query2XML::factory($db);
10
    $dom =& $query2xml->getXML(
11
        "SELECT
12
            *
13
         FROM
14
            artist
15
         ORDER BY
16
            artistid",
17
        array(
18
            'rootTag' => 'music_library',
19
            'rowTag' => 'artist',
20
            'idColumn' => 'artistid',
21
            'attributes' => array(
22
                '*' => '*',
23
                'genre' => array(
24
                    'value' => ':string',
25
                    'condition' => '#returnFalse'
26
                )
27
            )
28
        )
29
    );
30
    print $dom->saveXML();
31
 
32
    function returnFalse()
33
    {
34
        return false;
35
    }
36
?>
37
--EXPECT--
38
<?xml version="1.0" encoding="UTF-8"?>
39
<music_library><artist artistid="1" name="Curtis Mayfield" birth_year="1920" birth_place="Chicago"/><artist artistid="2" name="Isaac Hayes" birth_year="1942" birth_place="Tennessee"/><artist artistid="3" name="Ray Charles" birth_year="1930" birth_place="Mississippi"/></music_library>