Made some methods on SearchFilter public so that SearchFilters can be co-opted for other purposes. Really, moving the magic to a DataQuery object would be better

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@61067 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-08-19 10:09:28 +00:00
parent ec9a40ee50
commit ed07c0acf2

View File

@ -80,7 +80,7 @@ abstract class SearchFilter extends Object {
* *
* @return string * @return string
*/ */
protected function getDbName() { function getDbName() {
// SRM: This code finds the table where the field named $this->name lives // SRM: This code finds the table where the field named $this->name lives
// Todo: move to somewhere more appropriate, such as DataMapper, the magical class-to-be? // Todo: move to somewhere more appropriate, such as DataMapper, the magical class-to-be?
$candidateClass = $this->model; $candidateClass = $this->model;
@ -101,7 +101,7 @@ abstract class SearchFilter extends Object {
* @param SQLQuery $query * @param SQLQuery $query
* @return SQLQuery * @return SQLQuery
*/ */
protected function applyRelation($query) { function applyRelation($query) {
if (is_array($this->relation)) { if (is_array($this->relation)) {
foreach($this->relation as $rel) { foreach($this->relation as $rel) {
$model = singleton($this->model); $model = singleton($this->model);