我首先尝试使用 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.....