You are here

abstract class Braintree in Commerce Braintree 7

Braintree PHP Library

Provides methods to child classes. This class cannot be instantiated.

@copyright 2010 Braintree Payment Solutions

Hierarchy

Expanded class hierarchy of Braintree

6 string references to 'Braintree'
Braintree_AddressTest::testCreate in braintree_php/tests/integration/AddressTest.php
Braintree_AddressTest::testCreateNoValidate in braintree_php/tests/integration/AddressTest.php
Braintree_AddressTest::testFind in braintree_php/tests/integration/AddressTest.php
Braintree_TransactionAdvancedSearchTest::testSearchOnTextFields in braintree_php/tests/integration/TransactionAdvancedSearchTest.php
Braintree_TransactionTest::testSale_withAllAttributes in braintree_php/tests/integration/TransactionTest.php

... See full list

File

braintree_php/lib/Braintree.php, line 20

View source
abstract class Braintree {

  /**
   * @ignore
   * don't permit an explicit call of the constructor!
   * (like $t = new Braintree_Transaction())
   */
  protected function __construct() {
  }

  /**
   * @ignore
   *  don't permit cloning the instances (like $x = clone $v)
   */
  protected function __clone() {
  }

  /**
   * returns private/nonexistent instance properties
   * @ignore
   * @access public
   * @param string $name property name
   * @return mixed contents of instance properties
   */
  public function __get($name) {
    if (array_key_exists($name, $this->_attributes)) {
      return $this->_attributes[$name];
    }
    else {
      trigger_error('Undefined property on ' . get_class($this) . ': ' . $name, E_USER_NOTICE);
      return null;
    }
  }

  /**
   * used by isset() and empty()
   * @access public
   * @param string $name property name
   * @return boolean
   */
  public function __isset($name) {
    return array_key_exists($name, $this->_attributes);
  }
  public function _set($key, $value) {
    $this->_attributes[$key] = $value;
  }

  /**
   *
   * @param string $className
   * @param object $resultObj
   * @return object returns the passed object if successful
   * @throws Braintree_Exception_ValidationsFailed
   */
  public static function returnObjectOrThrowException($className, $resultObj) {
    $resultObjName = Braintree_Util::cleanClassName($className);
    if ($resultObj->success) {
      return $resultObj->{$resultObjName};
    }
    else {
      throw new Braintree_Exception_ValidationsFailed();
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Braintree::returnObjectOrThrowException public static function
Braintree::_set public function
Braintree::__clone protected function @ignore don't permit cloning the instances (like $x = clone $v)
Braintree::__construct protected function @ignore don't permit an explicit call of the constructor! (like $t = new Braintree_Transaction()) 1
Braintree::__get public function returns private/nonexistent instance properties @ignore @access public
Braintree::__isset public function used by isset() and empty() @access public