note 99039 added to solrquery.removesortfield
| From: | hasbridge at gmail dot com | Date: | Fri, 23 Jul 2010 21:16:35 +0000 |
| Subject: | note 99039 added to solrquery.removesortfield | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-171079@lists.php.net to get a copy of this message | ||
This method will generate a notice if you try and remove a sort field that isn't set. This can
happen if you call getSortFields, which will return an array like:
[0] => 'fieldName asc',
[1] => 'fieldName desc
But if you try and call:
<?php
$object->removeSortField('fieldName asc');
?>
You will get a notice. Instead, you need to truncate the sort order (' asc', '
desc') part of it. Something like:
<?php
$fieldName = trim(str_replace(array('asc', 'desc')), '', $fieldName);
?>
----
Server IP: 192.41.42.26
Probable Submitter: 66.196.231.211
----
Manual Page -- http://www.php.net/manual/en/solrquery.removesortfield.php
Edit -- https://master.php.net/note/edit/99039
Del: integrated -- https://master.php.net/note/delete/99039/integrated
Del: useless -- https://master.php.net/note/delete/99039/useless
Del: bad code -- https://master.php.net/note/delete/99039/bad+code
Del: spam -- https://master.php.net/note/delete/99039/spam
Del: non-english -- https://master.php.net/note/delete/99039/non-english
Del: in docs -- https://master.php.net/note/delete/99039/in+docs
Del: other reasons-- https://master.php.net/note/delete/99039
Reject -- https://master.php.net/note/reject/99039
Search -- https://master.php.net/manage/user-notes.php