Quick links: Content - sections - sub sections
EN FR
Quick Search Advanced search
 
Page

  [Opened] <eq property="" value="" /> doesn't seem to work?

Posted by Kirk on 11/04/2010 16:47

Hello, here I am with yet another message :D

This:

<method name="findAllStartedStates" type="select">
<code>
	<condition>
		<eq property="state" value="started" />
	</condition>
	<order>
		<orderitem property="name" way="asc" />
	</order>
</method> </code>

returns:

array (
<code>
  0 => 
  cDaoRecord_module_Jx_game_Jx_mysql::__set_state(array(
     'id' => '2',
     'name' => 'Game 2',
     'state' => 'created',
  )),
  1 => 
  cDaoRecord_module_Jx_game_Jx_mysql::__set_state(array(
     'id' => '1',
     'name' => 'Game 1',
     'state' => 'started',
  )),

)

</code>

in Jelix 1.1.7.

The database field is a:

set('created','started','stopped')

The game with id 2 should not be returned, I think. Is this a bug?

Note: The order appears off because I took out some sensitive info.

  [Opened] <eq property="" value="" /> doesn't seem to work?

Reply #1 Posted by foxmask on 11/04/2010 17:50

you can have a look at the cache temp/yourapp/compiled/daos/modules/youmodules/youdao~.....php and find the SQL generated about Query findAllStartedStates.

On my side i think you dont use findAllStartedStates but another method which return everything ;) something like a typo error in your class/controller ?

kind regards.


@GitHub - Forum HaveFnuBB! powered by Jelix - Le Booster Jelix !

  [Opened] <eq property="" value="" /> doesn't seem to work?

Reply #2 Posted by laurentj on 11/05/2010 15:32

I don't think this is a bug in jelix. Unit tests show that jDao works well on such comparison.

Did you declared the state poperty as a "string" into the dao file?

  [Opened] <eq property="" value="" /> doesn't seem to work?

Reply #3 Posted by Kirk on 11/10/2010 10:08

I looked in the compiled file and found:

<code>
 function findAllStartedStates (){
    $__query =  $this->_selectClause.$this->_fromClause.$this->_whereClause;

$__query .=' WHERE 1=1 ORDER BY `game`.`name` asc';

    $__rs = $this->_conn->query($__query);
    $this->finishInitResultSet($__rs);
    return $__rs;

}

</code>

I tried cleaning the temp directory but it generated the same result.

My property declaration looks like:

<property name="state" fieldname="state" datatype="string" />

  [Opened] <eq property="" value="" /> doesn't seem to work?

Reply #4 Posted by laurentj on 11/12/2010 10:44

Oh, I just see that : you wrote <condition> instead of <conditions>. Try with a "s" at the end of the name :)

  [Opened] <eq property="" value="" /> doesn't seem to work?

Reply #5 Posted by Kirk on 11/16/2010 09:31

Heh! It's always something ridiciously simple, isn't it? I almost feel bad for asking X^D

 
Page
  1. <eq property="" value="" /> doesn't seem to work?