Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

$this->Buildings->parseCriteria($this->Prg->parsedParams()) Returning Array 0 or Empty. #234

Open
ravenreaving opened this issue Aug 9, 2019 · 0 comments

Comments

@ravenreaving
Copy link

ravenreaving commented Aug 9, 2019

Using cakephp 2.8

Model Code

class Buildings extends AppModel {

public $name = 'Buildings';
public $actsAs = array(
	'Search.Searchable'
);

/**
 * Validation rules
 *
 * @var array
 */
public $hasMany = array(
    'BuildingMaintenances' => array(
        'className'     => 'BuildingMaintenances',
        'foreignKey'    => 'building_id'
     )
);

public $filterArgs = array(
	'owner_id' => array(
		'type' => 'where',
		'field' => 'owner_id'
	)
);

Controller

public $components = array(
	'Paginator' => array('paramType' => 'querystring'),
	'Search.Prg' => array(
		'commonProcess' => array('paramType' => 'querystring'),
		'presetForm' => array('paramType' => 'querystring')
	)
	);

Method

$this->Prg->commonProcess();
$this->Paginator->settings['conditions'] = $this->Buildings->parseCriteria($this->Prg->parsedParams());
// var_dump($this->Buildings->parseCriteria($this->Prg->parsedParams()));
$this->set('buildings', $this->Paginator->paginate());
$this->set(compact('ownerType'));

@ravenreaving ravenreaving changed the title I tried to var_dump $this->Prg->commonProcess() because the paramaters/conditions is not being passed in paginate query. this is the result. $this->Buildings->parseCriteria($this->Prg->parsedParams()) Returning Array 0 or Empty. Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant