Back to PhocacartPayment class

Method getAllPaymentMethods

public static
getAllPaymentMethods
(mixed $order = 'id', mixed $type = array())

Method getAllPaymentMethods - Source code

/* Used as shipping rule */
public static function getAllPaymentMethods($order = 'id', $type = array())
{
    $db = Factory::getDBO();
    $query = 'SELECT a.id AS value, a.title AS text' . ' FROM #__phocacart_payment_methods AS a';
    $query .= !empty($type) && is_array($type) ? ' WHERE a.type IN (' . implode(',', $type) . ')' : '';
    $query .= ' ORDER BY a.' . $order;
    $db->setQuery($query);
    $methods = $db->loadObjectList();
    return $methods;
}