public function testSetFetchClass() { $this->client->setFetchClass('PhpOrient\\TestClassRecord'); $this->assertEquals('PhpOrient\\TestClassRecord', PhpOrient::getFetchClass()); $this->client->setFetchClass('PhpOrient\\TestClass'); $this->assertNull(PhpOrient::getFetchClass()); }
/** * Override the ConfigurableTrait fromConfig method to handle custom classes for records * * @param array $options * * @return mixed */ public static function fromConfig(array $options = array()) { // Get the custom fetch class name if available $fetchClass = PhpOrient::getFetchClass(); if ($fetchClass) { $object = new $fetchClass(); } else { $object = new self(); } return $object->configure($options); }