Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Persistence in PHP with Doctrine ORM

You're reading from  Persistence in PHP with Doctrine ORM

Product type Book
Published in Dec 2013
Publisher Packt
ISBN-13 9781782164104
Pages 114 pages
Edition 1st Edition
Languages
Author (1):
Kevin Dunglas Kevin Dunglas
Author Profile Icon Kevin Dunglas
Kevin Dunglas
Toc

Understanding Doctrine Mapping Types


Doctrine Mapping Types used in the @Column annotation are neither SQL types nor PHP types but they are mapped to both. For instance, the Doctrine text type will be casted to the string PHP type in the entity and stored in a database column with the CLOB type.

The following is a correspondence table for Doctrine Mapping Type of PHP type and SQL type:

Doctrine Mapping Type

PHP Type

SQL Type

string

string

VARCHAR

integer

integer

INT

smallint

integer

SMALLINT

bigint

string

BIGINT

boolean

boolean

BOOLEAN

decimal

double

DECIMAL

date

\DateTime

DATETIME

time

\DateTime

TIME

datetime

\DateTime

DATETIME or TIMESTAMP

text

string

CLOB

object

object using the serialize() and unserialize() methods

CLOB

array

array using serialize() and unserialize() methods

CLOB

float

double

FLOAT (double precision)

simple_array

array using implode() and explode()

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime