Field::isUse($usetype[,$usetype...])
Version 3.8
Check if field implements given use
Version 3.8
Check if field implements given use
Return TRUE if field is implements one of the given use.
Bool
Show all contact information:
foreach ( $Customer->getFields() as $Field ){
if ( $Field->isUse('contact') ){
$txt .= "{$Field->getTitle()}: {$Field->getValue()}";
}
}
Note: Previous example could also be made using Page::getFieldsByUse() method:
foreach ( $Customer->getFieldsByUse('contact') as $Field ){
$txt .= "{$Field->getTitle()}: {$Field->getValue()}";
}