Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
problem with
  •         $tovary = Model_Tovar::find('all', array(
                        'related' => array(
                            'znacka',
                            'kategoria' => array(
                                'where' => array(
                                    'sekcia' => Session::get('sekcia.id')
                                ),
                            ),
                        ),
                        'where' => array(
                            array( 'novinka', 1 ),
                        ),
                     ));
    
    
    return Orm\UndefinedRelation [ Error ]: Relation "1" was not found in the model. when i tryed
        $tovary = Model_Tovar::find('all', array(
                        'related' => array(
                            'znacka' => array( ),
                            'kategoria' => array(
                                'where' => array( 'sekcia', Session::get('sekcia.id') )
                            )
                        ),
                        'where' => array(
                            array( 'novinka', 1 ),
                        )
                    ));
    
    return Orm\UndefinedRelation [ Error ]: Relation "sekcia" was not found in the model. what is bad ? i need
    - tovar.novinka = 1
    - kategoria.sekcia = Session::get('sekcia.id') THANKS
  • @admin please move to ORM section and correct title. sry :-)
  • Are you on the latest from the develop branch? Relation conditions are not yet supported in RC2 or RC2.1.
  • thanks but other problem (with last develop)
            $tovary = Model_Tovar::find('all', array(
                        'related' => array(
                            'znacka',
                            'kategoria' => array(
                                'where' => array(
                                    array( 'sekcia', '=', Session::get('sekcia.id') )
                                )
                            )
                        ),
                        'where' => array(
                            array( 'novinka', 1 ),
                        ),
                    ));
    

    ErrorException [ Warning ]: call_user_func_array() expects parameter 1 to be a valid callback, class 'Fuel\Core\Database_Query_Builder_Select' does not have a method 't2.sekcia'
  • Could you provide the full trackback including filenames & line nrs? I have an idea what might cause this, but it'll be much easier to debug if you post those.
  • I just committed a fix for this, if you're not using Git but downloading you only need to replace the orm/classes/query.php file.
  • yep. thats it. thanks ;)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion