src/Dev/FixtureFactory.php
public function get($class, $identifier)
    {
        $id = $this->getId($class, $identifier);
        if (!$id) {
            return null;
        }

        // If the class doesn't exist, look for a table instead
        if (!class_exists($class)) {
            $tableNames = DataObject::getSchema()->getTableNames();
            $potential = array_search($class, $tableNames);
            if (!$potential) {
                throw new \LogicException("'$class' is neither a class nor a table name");
            }
            $class = $potential;
        }

        return DataObject::get_by_id($class, $id);
    }
public function get($class, $identifier)
    {
        $id = $this->getId($class, $identifier);
        if (!$id) {
            return null;
        }

        // If the class doesn't exist, look for a table instead
        if (!class_exists($class)) {
            $tableNames = DataObject::getSchema()->getTableNames();
            $potential = array_search($class, $tableNames);
            if (!$potential) {
                throw new \LogicException("'$class' is neither a class nor a table name");
            }
            $class = $potential;
        }

        return DataObject::get_by_id($class, $id);
    }
public function get ( $ class , $ identifier ) { $ id = $ this -> getId ( $ class , $ identifier ) ; if ( ! $ id ) { return null ; } // If the class doesn't exist, look for a table instead if ( ! class_exists ( $ class ) ) { $ tableNames = DataObject :: getSchema ( ) -> getTableNames ( ) ; $ potential = array_search ( $ class , $ tableNames ) ; if ( ! $ potential ) { throw new \ LogicException ( "'$class' is neither a class nor a table name" ) ; } $ class = $ potential ; } return DataObject :: get_by_id ( $ class , $ id ) ; }
Get an object from the fixture.

@param string $class The data class or table name, as specified in your fixture file.  Parent classes won't work
@param string $identifier The identifier string, as provided in your fixture file
@return DataObject
Get an object from the fixture .