Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
about Model_Crud::get_connection
  • in PHP doc, it says Model_Crud::get_connection returns Database_Connection, but actually it retunrs string.
    If Model_Crud::get_connection returns Database_Connection, Model_Crud::count method won't work properly,


    // Get the database group / connection
    $connection = static::get_connection();

    // Get the columns
    $columns = \DB::expr('COUNT('.($distinct ? 'DISTINCT ' : '').
    \Database_Connection::instance($connection)->quote_identifier($select).
    ') AS count_result');


    I'm not sure which is wrong, but one of them(php doc or count method) must be fixed I think.

    But I don't know what should I do for it.
  • HarroHarro
    Accepted Answer
    I think both are wrong, because the docs imply it's an object and the code implies it's a string.

    But technically, it can be both, you have to define the connection in your model, and both the database profile name (as a string) and a Database_Connection object are accepted.

  • Hi, Harro.

    Thank you for the update.
    It makes things clearly.

Howdy, Stranger!

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

In this Discussion