private function hydrateDataObject($data)
    {
        $dataObject = new MetadataDataObjectOracle(
            new MetaDataColumnCollection(),
            new MetaDataRelationCollection()
        );

        $tableName = $data['TABLE_NAME'];
        $owner     = $data['OWNER'];

        $dataObject->setName($owner . '/' . $tableName);
        $columnDataObject = new MetaDataColumn();

        $statement = $this->pdo->prepare(
            sprintf(
                "SELECT COLUMN_NAME as name, NULLABLE as  nullable, DATA_TYPE as type, DATA_LENGTH as length
                FROM SYS.ALL_TAB_COLUMNS
                WHERE TABLE_NAME = '%s' and OWNER= '%s'",
                $tableName,
                $owner
            )
        );
        $statement->execute(array());

        $allFields   = $statement->fetchAll(PDO::FETCH_ASSOC);
        $identifiers = $this->getIdentifiers($owner, $tableName);

        foreach ($allFields as $metadata) {
            $column = clone $columnDataObject;

            $type = $metadata['type'];

            if (isset($this->typeConversion[$type]) === true) {
                $type = $this->typeConversion[$type];
            }

            $column->setName($metadata['name'])
                   ->setType($type)
                   ->setLength(
                       isset($metadata['length']) === true ?
                       $metadata['length'] :
                       null
                   );
            if (in_array($metadata['name'], $identifiers) === true) {
                $column->setPrimaryKey(true);
            }

            $dataObject->appendColumn($column);
        }

        return $dataObject;
    }
private function hydrateDataObject($data)
    {
        $dataObject = new MetadataDataObjectOracle(
            new MetaDataColumnCollection(),
            new MetaDataRelationCollection()
        );

        $tableName = $data['TABLE_NAME'];
        $owner     = $data['OWNER'];

        $dataObject->setName($owner . '/' . $tableName);
        $columnDataObject = new MetaDataColumn();

        $statement = $this->pdo->prepare(
            sprintf(
                "SELECT COLUMN_NAME as name, NULLABLE as  nullable, DATA_TYPE as type, DATA_LENGTH as length
                FROM SYS.ALL_TAB_COLUMNS
                WHERE TABLE_NAME = '%s' and OWNER= '%s'",
                $tableName,
                $owner
            )
        );
        $statement->execute(array());

        $allFields   = $statement->fetchAll(PDO::FETCH_ASSOC);
        $identifiers = $this->getIdentifiers($owner, $tableName);

        foreach ($allFields as $metadata) {
            $column = clone $columnDataObject;

            $type = $metadata['type'];

            if (isset($this->typeConversion[$type]) === true) {
                $type = $this->typeConversion[$type];
            }

            $column->setName($metadata['name'])
                   ->setType($type)
                   ->setLength(
                       isset($metadata['length']) === true ?
                       $metadata['length'] :
                       null
                   );
            if (in_array($metadata['name'], $identifiers) === true) {
                $column->setPrimaryKey(true);
            }

            $dataObject->appendColumn($column);
        }

        return $dataObject;
    }
private function hydrateDataObject ( $ data ) { $ dataObject = new MetadataDataObjectOracle ( new MetaDataColumnCollection ( ) , new MetaDataRelationCollection ( ) ) ; $ tableName = $ data [ 'TABLE_NAME' ] ; $ owner = $ data [ 'OWNER' ] ; $ dataObject -> setName ( $ owner . '/' . $ tableName ) ; $ columnDataObject = new MetaDataColumn ( ) ; $ statement = $ this -> pdo -> prepare ( sprintf ( "SELECT COLUMN_NAME as name, NULLABLE as  nullable, DATA_TYPE as type, DATA_LENGTH as length
                FROM SYS.ALL_TAB_COLUMNS
                WHERE TABLE_NAME = '%s' and OWNER= '%s'" , $ tableName , $ owner ) ) ; $ statement -> execute ( array ( ) ) ; $ allFields = $ statement -> fetchAll ( PDO :: FETCH_ASSOC ) ; $ identifiers = $ this -> getIdentifiers ( $ owner , $ tableName ) ; foreach ( $ allFields as $ metadata ) { $ column = clone $ columnDataObject ; $ type = $ metadata [ 'type' ] ; if ( isset ( $ this -> typeConversion [ $ type ] ) === true ) { $ type = $ this -> typeConversion [ $ type ] ; } $ column -> setName ( $ metadata [ 'name' ] ) -> setType ( $ type ) -> setLength ( isset ( $ metadata [ 'length' ] ) === true ? $ metadata [ 'length' ] : null ) ; if ( in_array ( $ metadata [ 'name' ] , $ identifiers ) === true ) { $ column -> setPrimaryKey ( true ) ; } $ dataObject -> appendColumn ( $ column ) ; } return $ dataObject ; }
Convert PDOmapping to CrudGenerator mapping
@return MetadataDataObjectOracle
Convert PDOmapping to CrudGenerator mapping