PayPal\Core\PPConfigManager::get PHP Méthode

get() public méthode

simple getter for configuration params If an exact match for key is not found, does a "contains" search on the key
public get ( $searchKey )
    public function get($searchKey)
    {
        if (array_key_exists($searchKey, $this->config)) {
            return $this->config[$searchKey];
        } else {
            $arr = array();
            foreach ($this->config as $k => $v) {
                if (strstr($k, $searchKey)) {
                    $arr[$k] = $v;
                }
            }
            return $arr;
        }
    }

Usage Example

 /**
  * @test
  */
 public function testGet()
 {
     $ret = $this->object->get('acct1');
     $this->assertContains('jb-us-seller_api1.paypal.com', $ret);
     $this->assertArrayHasKey('acct1.UserName', $ret);
     $this->assertTrue(sizeof($ret) == 7);
     $ret = $this->object->get('acct1.UserName');
     $this->assertEquals('jb-us-seller_api1.paypal.com', $ret);
     $ret = $this->object->get("acct");
     $this->assertEquals(sizeof($ret), 10);
 }