Skip to content

Commit

Permalink
#364 - Sync with changes in 0.19.7
Browse files Browse the repository at this point in the history
  • Loading branch information
johanjanssens committed Mar 7, 2021
1 parent 752187b commit f9052ad
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions contrib/extensions/k2/model/articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public function __construct(KObjectConfig $config)
parent::__construct($config);

$this->getState()
->insert('id' , 'cmd', null, true)
->insert('slug' , 'cmd', null, true)
->insertUnique('id' , 'cmd')
->insertUnique('slug', 'cmd')
->insert('category' , 'cmd')
->insert('tags' , 'cmd')

Expand Down Expand Up @@ -47,15 +47,15 @@ public function getAliases()
return $this->getConfig()->aliases;
}

public function fetchData($count = false)
public function getQuery($columns = true)
{
$state = $this->getState();

$query = $this->getObject('database.query.select')
->table(array('tbl' => $this->getTable()->getName()));

//#__content
if(!$count)
if($columns)
{
//#__tags
$query->columns([
Expand Down
6 changes: 3 additions & 3 deletions contrib/extensions/k2/model/attachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function __construct(KObjectConfig $config)
parent::__construct($config);

$this->getState()
->insert('id', 'cmd', null, true)
->insertUnique('id', 'cmd')
->insert('article', 'int');
}

Expand All @@ -29,14 +29,14 @@ protected function _initialize(KObjectConfig $config)
parent::_initialize($config);
}

public function fetchData($count = false)
public function getQuery($columns = true)
{
$state = $this->getState();

$query = $this->getObject('database.query.select')
->table(array('tbl' => $this->getTable()->getName()));

if(!$count)
if($columns)
{
$query->columns([
'id' => 'tbl.id',
Expand Down
6 changes: 3 additions & 3 deletions contrib/extensions/k2/model/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function __construct(KObjectConfig $config)
parent::__construct($config);

$this->getState()
->insert('id' , 'cmd', null, true)
->insertUnique('id' , 'cmd')
->insert('published' , 'boolean')
->insert('access' , 'cmd', array_unique($this->getObject('user')->getRoles()))
;
Expand All @@ -31,15 +31,15 @@ protected function _initialize(KObjectConfig $config)
parent::_initialize($config);
}

public function fetchData($count = false)
public function getQuery($columns = true)
{
$state = $this->getState();

$query = $this->getObject('database.query.select')
->table(array('tbl' => $this->getTable()->getName()));

//#__k2_categories
if(!$count)
if($columns)
{
$query->columns([
'id' => 'tbl.id',
Expand Down
6 changes: 3 additions & 3 deletions contrib/extensions/k2/model/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function __construct(KObjectConfig $config)
parent::__construct($config);

$this->getState()
->insert('id', 'cmd', null, true)
->insertUnique('id', 'cmd')
->insert('group' , 'int')
->insert('published' , 'boolean');
}
Expand All @@ -30,14 +30,14 @@ protected function _initialize(KObjectConfig $config)
parent::_initialize($config);
}

public function fetchData($count = false)
public function getQuery($columns = true)
{
$state = $this->getState();

$query = $this->getObject('database.query.select')
->table(array('tbl' => $this->getTable()->getName()));

if(!$count)
if($columns)
{
$query->columns([
'id' => 'tbl.id',
Expand Down

0 comments on commit f9052ad

Please sign in to comment.