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

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

Hello, here I am with yet another message grin

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?

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 wink something like a typo error in your class/controller ?

kind regards.


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

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

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?

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?

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

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

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?