\DB\Cortex Fatal error: Declaration of DB\Cortex::count($filter = NULL, $ttl = 60)

46 views
Skip to first unread message

Dean Bateman

unread,
May 30, 2017, 9:32:01 PM5/30/17
to Fat-Free Framework

I'm new to programming but I am using fat-free to learn and I love it but I am trying to change my app over to use cortex

but I keep getting this error, and I just can't seem to fix it

Fatal error: Declaration of DB\Cortex::count($filter = NULL, $ttl = 60) must be compatible with DB\Cursor::count($filter = NULL, array $options = NULL, $ttl = 0) in C:\WebServer\vhosts\site1\vendor\ikkez\f3-cortex\lib\db\cortex.php on line 29


fat-free = 3.6.1
Cortex ORM = 
1.4.1

this is my database set up

function __construct() {

$f3 = \Base::instance();
$this->f3=$f3;

$db= new \DB\SQL(
   $f3->get('dev'),
   $f3->get('dbuser'),
   $f3->get('dbpass'),
   array( \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION )
);

$this->f3->set('DB', $db );
$this->db=$db;
}

this is my model
<?php 

namespace Model;

class Articles extends \DB\Cortex {
  protected
    $db = 'DB',     // F3 hive key of a valid DB object
    $table = 'db_articles';   // the DB table to work on
}

and I am calling this in my controller

$articles = new \Model\Articles();
$articles->load(array('approved = ?',1));


what am I doing wrong ? 

ved

unread,
May 31, 2017, 5:19:44 PM5/31/17
to Fat-Free Framework
Have you tried updating cortex to the latest version? That one seems a bit dated.

Dean Bateman

unread,
May 31, 2017, 9:39:43 PM5/31/17
to Fat-Free Framework
I installed via composer

"composer require ikkez/f3-cortex"

updated as well no change.

I checked the change log and it hadn't been updated on v1.4.2 or 1.4.3 so I was using the current stable release still no change I was receiving the same error

but I manually downloaded the master copy from Github and bingo we are in play. so thank you for the suggestion
Reply all
Reply to author
Forward
0 new messages