Пример #1
0
 /**
  * Retrive the all values for given field id.
  *
  * @param int $fieldId
  *   Price_field_id.
  * @param array $values
  *   (reference ) to hold the values.
  * @param string $orderBy
  *   For order by, default weight.
  * @param bool|int $isActive is_active, default false
  *
  * @return array
  *
  */
 public static function getValues($fieldId, &$values, $orderBy = 'weight', $isActive = FALSE)
 {
     $fieldValueDAO = new CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue();
     $fieldValueDAO->price_field_id = $fieldId;
     $fieldValueDAO->orderBy($orderBy, 'label');
     if ($isActive) {
         $fieldValueDAO->is_active = 1;
     }
     $fieldValueDAO->find();
     while ($fieldValueDAO->fetch()) {
         CRM_Core_DAO::storeValues($fieldValueDAO, $values[$fieldValueDAO->id]);
     }
     return $values;
 }