public function resolveSearchAttributesFromSourceData() { $anyMixedAttributes = SearchUtil::resolveSearchAttributesFromArray(get_class($this->model), get_class($this->model), $this->getSourceData()); if ($anyMixedAttributes != null) { return $anyMixedAttributes; } if ($this->model->anyMixedAttributes != null) { //might need to run this through the @see SearchUtil::getSearchAttributesFromSearchArray but not sure. return array('anyMixedAttributes' => $this->model->anyMixedAttributes); } return array(); }
public function testResolveSearchAttributesFromGetArrayForAnyMixedAttributeScopeName() { $_GET['testing'] = array('a' => '0', SearchForm::ANY_MIXED_ATTRIBUTES_SCOPE_NAME => 'something', SearchForm::SELECTED_LIST_ATTRIBUTES => array('something')); $newArray = SearchUtil::resolveSearchAttributesFromArray('testing', 'AAASearchFormTestModel', $_GET); $this->assertEquals(array('a' => '0'), $newArray); $_GET['testing'] = array('a' => '0', SearchForm::ANY_MIXED_ATTRIBUTES_SCOPE_NAME => null, SearchForm::SELECTED_LIST_ATTRIBUTES => null); $newArray = SearchUtil::resolveSearchAttributesFromArray('testing', 'AAASearchFormTestModel', $_GET); $this->assertEquals(array('a' => '0'), $newArray); $_GET['testing'] = array('a' => '0', SearchForm::ANY_MIXED_ATTRIBUTES_SCOPE_NAME => array(), SearchForm::SELECTED_LIST_ATTRIBUTES => array()); $newArray = SearchUtil::resolveSearchAttributesFromArray('testing', 'AAASearchFormTestModel', $_GET); $this->assertEquals(array('a' => '0'), $newArray); $_GET['testing'] = array('a' => '0', SearchForm::ANY_MIXED_ATTRIBUTES_SCOPE_NAME => array('a' => 'b'), SearchForm::SELECTED_LIST_ATTRIBUTES => array('a' => 'b')); $newArray = SearchUtil::resolveSearchAttributesFromArray('testing', 'AAASearchFormTestModel', $_GET); $this->assertEquals(array('a' => '0'), $newArray); }
public function resolveSearchAttributesFromSourceData() { return SearchUtil::resolveSearchAttributesFromArray(get_class($this->model), get_class($this->model), $this->getSourceData()); }