Subversion Repositories ezrating

[/] [trunk/] [extension/] [ezrating/] [autoloads/] [ezratingoperator.php] - Diff between revs 5 and 6

Show entire file | Ignore whitespace | Details | Blame | View Log

Rev 5 Rev 6
Line 5... Line 5...
    function eZRatingOperator()
    function eZRatingOperator()
    {
    {
        $this->Operators = array( 'ezrating_summary' );
        $this->Operators = array( 'ezrating_summary' );
    }
    }
 
 
    function &operatorList()
    function operatorList()
    {
    {
        return $this->Operators;
        return $this->Operators;
    }
    }
 
 
    function namedParameterPerOperator()
    function namedParameterPerOperator()
Line 29... Line 29...
                    'required' => true )
                    'required' => true )
            )
            )
        );
        );
    }
    }
 
 
    function modify( &$tpl, &$operatorName, &$operatorParameters, &$rootNamespace, &$currentNamespace, &$operatorValue, &$namedParameters )
    function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters )
    {
    {
        switch ( $operatorName )
        switch ( $operatorName )
        {
        {
            case 'ezrating_summary':
            case 'ezrating_summary':
            {
            {
                $classAttrID = $namedParameters['class_attribute_id'];
                $classAttrID = $namedParameters['class_attribute_id'];
                $nodeID = $namedParameters['node_id'];
                $nodeID = $namedParameters['node_id'];
 
 
                include_once( 'lib/ezdb/classes/ezdb.php' );
                $db = eZDB::instance();
                $db =& eZDB::instance();
 
 
 
                $sql = "SELECT COUNT(a.data_int) AS reviewer_count, AVG(a.data_int) AS average_rating, MIN(a.data_int) AS min_rating, MAX(a.data_int) AS max_rating
                $sql = "SELECT COUNT(a.data_int) AS reviewer_count, AVG(a.data_int) AS average_rating, MIN(a.data_int) AS min_rating, MAX(a.data_int) AS max_rating
                        FROM ezcontentobject_attribute a, ezcontentclass_attribute ca, ezcontentobject o, ezcontentobject_tree n
                        FROM ezcontentobject_attribute a, ezcontentclass_attribute ca, ezcontentobject o, ezcontentobject_tree n
                        WHERE n.contentobject_id=o.id
                        WHERE n.contentobject_id=o.id
                          AND n.parent_node_id=$nodeID
                          AND n.parent_node_id=$nodeID