-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could we get propel build to run dump-autoload? #835
Comments
Why do you have to run |
@marcj I had to run it because Propel wasn't picking up my intermediary model |
Have you added the namespace to your composer.json? It should then be found automatically. |
@marcj Yes, my {
"name": "patontheback",
"minimum-stability": "dev",
"require": {
"igorw/get-in": "~1.0",
"raven/raven": "dev-master",
"propel/propel": "~2.0@dev",
"monolog/monolog": "1.11.0"
},
"require-dev": {
"phpunit/phpunit": "3.7.*",
"mustangostang/spyc": "0.5.*"
},
"autoload": {
"classmap": ["application/propel/generated-classes/"]
}
} So what I did was that I added: <table name="language">
<column name="id" autoIncrement="true" type="integer" primaryKey="true"/>
<column name="code" required="true" type="VARCHAR" size="4"/>
<column name="name" required="true" type="VARCHAR" size="20"/>
<unique>
<unique-column name="code" />
</unique>
</table>
<table name="company_language" isCrossRef="true">
<column name="company_id" type="integer" primaryKey="true"/>
<column name="language_id" type="integer" primaryKey="true"/>
<foreign-key foreignTable="cms_company">
<reference local="company_id" foreign="com_id"/>
</foreign-key>
<foreign-key foreignTable="language">
<reference local="language_id" foreign="id"/>
</foreign-key>
</table> Then ran |
You should not use "autoload": {
"psr-4": {
"Model\\": "application/propel/generated-classes/"
}
}, |
@marcj Oh okay, I will do that and consider the issue closed. The docs http://propelorm.org/documentation/02-buildtime.html says: {
...
"autoload": {
"classmap": ["generated-classes/"]
}
} |
@marcj |
Thanks, I knew that. |
After running
build
for the first time my new model wasn't loading properly which after an hour+ of digging around was because I needed to runcomposer dump-autoload
. This is mentioned in the docs http://propelorm.org/documentation/02-buildtime.htmlWhen I mentioned it on gitter.im @staabm suggested making an issue to have propel run
dump-autoload
by itself.The conversation on gitter.im went like this:
I added a m2m relation between Company and Language, it seem to have generated all the related files but now I'm getting:
When I looked in the model directory CompanyLanguage.php is definitely there. Which then turned out I had to run
composer dump-autoload
.The text was updated successfully, but these errors were encountered: