2

I'm using codeigniter with Doctrine 2 with CodeIgniter2. I used YAML Schema files to define database schema. I want to define two columns in my table with MySQL data-type Double. Below is the YAML Mapping I tried

Entities\Location: type: entity table: locations fields: id: type: integer id: true generator: strategy: AUTO Name: type: string length: 40 nullable: false longitude: type: double latitude: type: double 

But the code throws error when I try to create Models from YAML.

Entities were created successfully.

The Error Messages are:

Class double does not exist while trying to create proxies

and

Unknown column type double requested while trying to create schema

0

1 Answer 1

2

In 1.2 I think it was 'float' or 'decimal'. Try one of those.

Here's a reference to the 1.2 docs... I'm struggling to find the 2.x docs that say the same thing.

http://www.doctrine-project.org/projects/orm/1.2/docs/manual/defining-models/pl

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks. I was able to create the schema successfully with type as float in YAML. And the database table field generated was double just as I wanted :-)
Ah good, I'm glad. I find it very strange how the none of the examples appear to use float types. :)
Just for reference, the documentation on the types for doctrine 2 are to be found here: docs.doctrine-project.org/projects/doctrine-orm/en/latest/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.