From 38bb120c88645ea6aebca4a59264cc71c19a672e Mon Sep 17 00:00:00 2001 From: ajshort Date: Sun, 10 Feb 2013 16:34:48 +1100 Subject: [PATCH] Remove no longer needed property access hacks. --- code/GridFieldOrderableRows.php | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/code/GridFieldOrderableRows.php b/code/GridFieldOrderableRows.php index 7b5775d..be30f7a 100644 --- a/code/GridFieldOrderableRows.php +++ b/code/GridFieldOrderableRows.php @@ -53,14 +53,8 @@ class GridFieldOrderableRows extends RequestHandler implements $field = $this->getSortField(); if($list instanceof ManyManyList) { - // @todo These should be publically accesible. - $reflector = new ReflectionObject($list); - - $extra = $reflector->getProperty('extraFields'); - $extra->setAccessible(true); - - $table = $reflector->getProperty('joinTable'); - $table->setAccessible(true); + $extra = $list->getExtraFields(); + $table = $list->getJoinTable(); if(array_key_exists($field, $extra->getValue($list))) { return $table->getValue($list); @@ -269,13 +263,8 @@ class GridFieldOrderableRows extends RequestHandler implements } if($list instanceof ManyManyList) { - $reflector = new ReflectionObject($list); - - $extra = $reflector->getProperty('extraFields'); - $extra->setAccessible(true); - - $key = $reflector->getProperty('localKey'); - $key->setAccessible(true); + $extra = $list->getExtraFields(); + $key = $list->getLocalKey(); if(array_key_exists($this->getSortField(), $extra->getValue($list))) { return sprintf('"%s" %s', $key->getValue($list), $value);