Hi,
I had a problem with the method Doctrine_Table::find(), since it's thorowing an exception of
SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
I solved the problem by using Doctrine::getTable('City')->findOneById($id); instead and it works fine.
When I tried to invistigate about t...
Hey All!
So I am somewhat new to symfony but am getting better by the day thanks to the symfony websites and stackoverflow! So, I have a module called articles, where I display a list of articles the I uploaded. On the index, its just lists all of the article. BUt i was wondering how I could make it so that if I click on the author, for...
So I have a module that displays articles. And I tried to make an action that displayed all article of a certain publication when that publication was clicked. I tried following the way to do this on the symfony jobeet tutorials but I ran into some new headaches. Since publications and authors can sometime be url unfriendly, I want to us...
In Doctrine you are provided with a Constant Variable that allows you to set a global Identifier column in all of the models that are generated by Doctrine's code. I am trying to figure out how I can override/shut off this value so that it does not create this column in a specific table.
The Constant is:
ATTR_DEFAULT_IDENTIFIER_OPTION...
I am having issues getting my database to build from my YAML file.
Here is the error:
./scripts/doctrine-cli build-all-load
build-all-load - Generated models successfully from YAML schema
build-all-load - Couldn't locate driver named mysql
build-all-load - Created tables successfully
build-all-load - Data was successfully loaded
It b...
Hi,
Is there a method in doctrine like hibernate findByExample method?
thanks
...
I'm trying to upgrade my doctrine ORM from 1.1.6 to 1.2.1 but i've enountered a BC issue with table names.
Some of my table names have several words (e.g. t_foo_bar for class FooBar) where the t_ prefix is generated automatically with:
$manager->setAttribute(Doctrine_Core::ATTR_TBLNAME_FORMAT, 't_%s');
This worked well in previous ve...
I have Doctrine setup in my Zend Framework application and I built my schema YAML file. But when I tell Doctrine to build the tables it says it does but it doesn't actually make them. It creates the models, and will create the DB but it will not populate the DB with the tables and throws no errors. Does anyone have a guess or know why th...
How do I check if field has changed?
I'd like to trigger an action in preSave() only if specific field has changed, e.q.
public function preSave() {
if ($bodyBefore != $bodyNow) {
$this->html = $this->_htmlify($bodyNow);
}
}
The question is how to get this $bodyBefore and $bodyNow :)
...
Hi,
I'm starting a new project with symfony which is readily integrated with Doctrine and Propel, but I of course need to make a choice.... I was wondering if more experienced people out there have general pros and/or cons for going with either of these two?
Thanks a lot.
EDIT:
Thanks for the all the responses, useful stuff. There's n...
I've seen a lot of articles about integrating ZF and Doctrine. There is also a proposal for ZF here but they have always two possible structures. Either they put all models into one top level model directory or they put it into a module related model directory.
application
|-- Bootstrap.php
|-- configs
|-- controllers
|-- models ...
I can't find a way to set the default hydrator in Doctrine. It should be available. Right?
http://www.doctrine-project.org/documentation/manual/1_2/en/data-hydrators#writing-hydration-method
The above documentation page explains how to create a custom hydrator. The drawback here is that you need to "specify" the hydrator each and every...
Hi,
I am making use of the admin generator in Symfony 1.4, which is 99% working as I want it to simply using the options in the generator.yml config file.
The problem I have is that I wish to specify which columns are displayed in the list view using a filter (as opposed to configuring them in generator.yml).
I have successfully creat...
Does Doctrine support setting individual columns to charset UTF8? Documentation seems to refer to table-level only.
Please advise. Thanks.
...
Problem was solved check my answer
Hi,
I'm having a trouble with getting the id after inserting a new Record using PHP Doctrine Project.
In inserting a new record in a table with no parent table (no foreign key) no problem happens.
But when inserting a related record here comes the problem, that I get only the parent id which is use...
Hi all,
I am planning to use doctrine to write a module of my app which is built with codeigniter.
I have a very basic question :
lets say I have a table called "user", with doctrine generate-models from db, 3 classes are generated BaseUser.php, User.php and UserTable.php. Now as I saw in the examples they use User class straigtaway. ...
Hi there!
Can anyone please tell me how can I add a new column of type enum to my schema in order to implement a Doctrine Migration?
Thanks in advance,
Best regards!
...
Hi,
I don't want an empty email field in my form to trigger a
Doctrine_Validator_Exception. But, since Doctrine_Validator_Email uses
"is_null()" to check for empty (non-existing) values (and the POST
['email'] contains an empty string), it does.
Is this correct? Is there a simple way around this?
This also has an impact when try...
I have a collection of items to save to database, but I want the record to be inserted only if not exists.
I think the most effective way would be to filter the collection before saving. Can Doctrine do it automatically?
Or shall I get all id's of all items in the collection, then query the database for items which do not exists on the...
I am using the Propel ORM with SF (1.4). I am writing a class, and I need to rewrite a query Doctrine query into Propel:
$q = Doctrine_Core::getTable('sfGuardRememberKey')->createQuery('r')
->innerJoin('r.sfGuardUser u')
->where('r.remember_key = ?', $cookie);
if ($q->count()){ // Do Something }
can anyone help wi...