예제 #1
0
 public function testSetFetchClass()
 {
     $this->client->setFetchClass('PhpOrient\\TestClassRecord');
     $this->assertEquals('PhpOrient\\TestClassRecord', PhpOrient::getFetchClass());
     $this->client->setFetchClass('PhpOrient\\TestClass');
     $this->assertNull(PhpOrient::getFetchClass());
 }
예제 #2
0
 /**
  * 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);
 }