Welcome Guest, Not a member yet? Register   Sign In
Codeigniter2.0 with Doctrine
#1

[eluser]Unknown[/eluser]
Hi I`m trying to have an innerJoin:
Doctrine_query::create()->from('users')->innerJoin('user_details')->execute();


Fatal error: Uncaught exception 'Doctrine_Table_Exception' with message 'Unknown relation alias ' in C:\www\xampp\htdocs\cams2\application\helpers\doctrine\Doctrine\Relation\Parser.php:237 Stack trace: #0 C:\www\xampp\htdocs\cams2\application\helpers\doctrine\Doctrine\Relation\Parser.php(235): Doctrine_Relation_Parser->getRelation('', false) #1 C:\www\xampp\htdocs\cams2\application\helpers\doctrine\Doctrine\Table.php(1001): Doctrine_Relation_Parser->getRelation('', true) #2 C:\www\xampp\htdocs\cams2\application\helpers\doctrine\Doctrine\Query.php(1744): Doctrine_Table->getRelation('') #3 C:\www\xampp\htdocs\cams2\application\helpers\doctrine\Doctrine\Query\From.php(88): Doctrine_Query->load('user_details:') #4 C:\www\xampp\htdocs\cams2\application\helpers\doctrine\Doctrine\Query\Abstract.php(2077): Doctrine_Query_From->parse('INNER JOIN user...') #5 C:\www\xampp\htdocs\cams2\application\helpers\doctrine\Doctrine\Query.php(1167): Doctrine_Query_Abstract->_processDqlQueryPart('from', Array) #6 C:\www\xampp\htdocs\cams2\appl in C:\www\xampp\htdocs\cams2\application\helpers\doctrine\Doctrine\Relation\Parser.php on line 237

Here is the schema.yml. Thanks

users:
connection: default
tableName: users
columns:
id:
type: integer(11)
autoincrement: true
primary: true
notnull: true
username:
type: varchar(25)
notnull: true
unique: true
password:
type: varchar(52)
notnull: true
email:
type: varchar(100)
notnull: true
hash:
type: varchar(52)
notnull: true
status:
values:
- approved
- canceled
- rejected
- refunded
- pending
type: enum()
notnull: true
auto_bill:
type: boolean(1)
notnull: true
locked:
type: boolean(1)
notnull: true
warn_add_date:
notnull: false
default: null
type: integer(11)
imported_user:
type: boolean(0)
notnull: true
subscription_expire:
notnull: true
default: 0
type: integer(11)
affiliate_id:
notnull: false
default: null
type: integer(11)
affiliate_type:
notnull: false
default: null
type: integer(2)
affiliate_sub_type:
notnull: false
default: null
type: integer(2)
force_bill:
notnull: true
default: 0
type: integer(1)
relations:
user_detail:
refClass: user_details
class: user_details
local: id
foreign: user_id
type: one
User_details:
local: user_id
foreign: id
type: one
user_details:
local: id
foreign: id
type: many
User_details:
connection: default
tableName: user_details
columns:
id:
type: integer(11)
autoincrement: true
primary: true
notnull: true
user_id:
type: integer(11)
notnull: true
register_date:
type: integer(11)
notnull: true
register_ip:
type: integer(11)
notnull: true
activation_code:
type: varchar(40)
notnull: true
country_code:
type: varchar(2)
notnull: true
dhdmedia_user:
notnull: false
default: null
type: varchar(30)
dhdmedia_password:
notnull: false
default: null
type: varchar(30)
dhdmedia_cust_id:
notnull: false
default: null
type: integer(11)
last_4:
notnull: false
default: null
type: integer(4)
lock_message:
notnull: false
default: null
type: varchar(255)
lock_ammount:
notnull: false
default: null
type: integer(4)
warning_answer:
values:
- agree
- disagree
notnull: false
default: null
type: enum()
canceled_subscription:
values:
- no
- by_user
- by_admin
- by_4pbilling
- by_dhdmedia
notnull: false
default: null
type: enum()
allow_newsletter:
type: boolean(1)
notnull: true
suspect:
type: boolean(25)
notnull: true
campaign:
notnull: false
default: null
type: integer(6)
affiliate_notice:
type: boolean(25)
notnull: true
mpa3_notice:
type: boolean(25)
notnull: true
full_aff:
notnull: false
default: null
type: text()
cupon:
type: boolean(25)
notnull: true
safe:
type: boolean(25)
notnull: true
show_warning:
type: boolean(25)
notnull: true
relations:
user:
refClass: users
class: users
local: user_id
foreign: id
type: one
users:
local: id
foreign: user_id
type: many
#2

[eluser]predat0r[/eluser]
ask here maybe:

http://www.phpandstuff.com/




Theme © iAndrew 2016 - Forum software by © MyBB