Page 1 of 1

getTitle on an array

PostPosted: Fri Feb 24, 2012 9:51 am
by wisni1rr
I have a field that is a multi-checkbox from a valuelists. This field also serves as the title field for this record. However, my function simply returns the word 'array'.

Code: Select all
function getTitle(&$record){
      return $record->val('Exterior');
   }


Any ideas?

Re: getTitle on an array

PostPosted: Fri Feb 24, 2012 11:04 am
by shannah
Multi-checkbox fields are stored as an array. The val() method returns the contents of a field as they are stored (dates will also return arrays). If you want to ensure that you are getting the string version you should use either strval() or display()

Re: getTitle on an array

PostPosted: Fri Feb 24, 2012 1:05 pm
by wisni1rr
Thank you so much.