public function resolveSearchAttributesFromSourceData()
 {
     $anyMixedAttributes = SearchUtil::resolveSearchAttributesFromGetArray(get_class($this->model), get_class($this->model));
     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 resolveSearchAttributesFromSourceData()
 {
     return SearchUtil::resolveSearchAttributesFromGetArray(get_class($this->model), get_class($this->model));
 }
Пример #3
0
 public function testResolveSearchAttributesFromGetArrayForAnyMixedAttributeScopeName()
 {
     $_GET['testing'] = array('a' => '0', SearchForm::ANY_MIXED_ATTRIBUTES_SCOPE_NAME => 'something', SearchForm::SELECTED_LIST_ATTRIBUTES => array('something'));
     $newArray = SearchUtil::resolveSearchAttributesFromGetArray('testing', 'AAASearchFormTestModel');
     $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::resolveSearchAttributesFromGetArray('testing', 'AAASearchFormTestModel');
     $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::resolveSearchAttributesFromGetArray('testing', 'AAASearchFormTestModel');
     $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::resolveSearchAttributesFromGetArray('testing', 'AAASearchFormTestModel');
     $this->assertEquals(array('a' => '0'), $newArray);
 }