getTitle on an array

A place for users and developers of the Xataface to discuss and receive support.

getTitle on an array

Postby wisni1rr » Fri Feb 24, 2012 9:51 am

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?
wisni1rr
 
Posts: 107
Joined: Mon Feb 13, 2012 9:03 pm

Re: getTitle on an array

Postby shannah » Fri Feb 24, 2012 11:04 am

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()
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: getTitle on an array

Postby wisni1rr » Fri Feb 24, 2012 1:05 pm

Thank you so much.
wisni1rr
 
Posts: 107
Joined: Mon Feb 13, 2012 9:03 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 26 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved