我正在尝试使用symfony 1.4创建一个应用程序,我首先安装了使用symfony框架工作创建的橙色hrm 2.7版本应用程序现在我正在为新应用程序创建模式但在我的应用程序中我使用的是现有表格作为我的新应用程序中的关系列,两个应用程序都在同一个数据库中,我已将database.yml配置为
all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: 'mysql:host=localhost;dbname=neworangehrm'
username: root
password: null
我将我的架构创建为
samplepayperiod:
tableName: samplepayperiod
columns:
emp_number:
name: emp_number
type: integer(7)
periodid:
name: periodid
type: integer(11)
primary: true
startdate:
name: starttime
type: date(25)
default: ''
notnull: true
enddate:
name: endtime
type: date(25)
default: ''
notnull: true
locked:
name: locked
type: smallint(5)
default: ''
relations:
Employee:
onDelete: CASCADE
foreignAlias: samplepayperiods
然后我用来运行以下命令
C:\xampp\htdocs\orangehrm\neworangehrm\nohrm>php symfony doctrine:build-model
>> doctrine generating model classes
>> file+ C:\Documents and Settings\Dilli...\Temp/doctrine_schema_56849.yml
PHP Notice: Undefined index: class in C:\xampp\php\PEAR\symfony\plugins\sfDoctrinePlugin\lib\vendor
\doctrine\Doctrine\Import\Builder.php on line 684
Notice: Undefined index: class in C:\xampp\php\PEAR\symfony\plugins\sfDoctrinePlugin\lib\vendor\doct
rine\Doctrine\Import\Builder.php on line 684
PHP Notice: Undefined index: alias in C:\xampp\php\PEAR\symfony\plugins\sfDoctrinePlugin\lib\vendor
\doctrine\Doctrine\Import\Builder.php on line 685
Notice: Undefined index: alias in C:\xampp\php\PEAR\symfony\plugins\sfDoctrinePlugin\lib\vendor\doct
rine\Doctrine\Import\Builder.php on line 685
>> tokens C:/xampp/htdocs/orangehrm/newor...e/Basesamplepayperiod.class.php
>> autoload Resetting application autoloaders
>> file- C:/xampp/htdocs/orangehrm/newor.../config/config_autoload.yml.php
我还试图创建下面的方案
起初我在数据库中创建了一个表
然后尝试按php symfony doctrine:build-schema
运行架构
但它正在抛出如下错误
C:\xampp\htdocs\orangehrm\neworangehrm\nohrm>php symfony doctrine:build-schema
>> doctrine generating yaml schema from database
Couldn't find class OhrmLocation
PHP Fatal error: Call to a member function evictAll() on a non-object in C:\xampp\php\PEAR\symfony\
plugins\sfDoctrinePlugin\lib\vendor\doctrine\Doctrine\Connection.php on line 1239
Fatal error: Call to a member function evictAll() on a non-object in C:\xampp\php\PEAR\symfony\plugi
ns\sfDoctrinePlugin\lib\vendor\doctrine\Doctrine\Connection.php on line 1239.....