I need to set value in mapped record to some arbitrary sql expression, so on obj.save() it would be used directly, w/out escaping/quoting.
Something like this:
obj.location = "Point($x, $y)";
obj.save();
Which should result in query like UPDATE ... SET location = Point(..., ...) WHERE ...;
However I cannot find anything like this i...
I'm using symfony 1.4 and doctrine. I've spent the last couple days playing with my schema, and I've gotten it to load up / build / behave properly but only on my local machine. When I copy the files to an account on Dreamhost, change the configuration to allow a connection to that database (and nothing else) I get the following error tr...
I'm having trouble executing a Doctrine DQL Query. This is the error it gives me.
Doctrine\Common\Annotations\AnnotationException: [Syntax Error] Expected PlainValue,
got 'integer' at position 13 in property Base\Session::$lifetime.
My code looks like this:
$query = $em->createQuery("SELECT s FROM Base\Session s WHERE s.session = \"...
I was wondering if it is possible to bind an array of integers as a parameter, so I could do something like this?
$q = Doctrine_Query::create()
->update('blah c')
->set('ignored', true)
->where('id in ?', array(1,2,3,4));
I guess that this isn't possible because it actually b...
hi, i'm using symfony 1.4, and my schema is as follows:
Auditor: columns:
id:
type: integer
autoincrement: true
primary: true
username:
type: string(255)
password:
type: string(255)
fullname:
type: string(255)
is_auditor:
type: integer
is_manager:
type: integer
...
I have wrote universal script to get all rows from Doctrine Table Models, but if rows amount is too large, i get exception:
Cannot define NULL as part of query when defining 'offset'.
Running script:
$table = new JV_Model_StoreOrder();
$this->data['list'] = $table->getTable()->findAll()->toArray();
I understand from the error above...
I'm using Doctrine 1.2 with Zend Framework, and it's working just fine. Now I want to start using the results cache and query caching capabilities to reduce the load on DB server that powers the application. Oh, I'm also using Zend_Application and placing code in modules.
Anyway, I setup my connections to Doctrine in the overall Boots...
I know this has to have an easy answer, but I cannot figure it out. After tears, I am hoping someone here can help.
Here is my YML model:
Identity:
columns:
id:
type: integer(10)
primary: true
autoincrement: true
username:
type: string(255)
Profile:
columns:
id:
...
How can I get the last insert id with doctrine 2 ORM? I didn't find this in the documentation of doctrine, is this even possible?
...
I'm using Doctrine together with CodeIgniter.
I have can't quite figure out the logic of why the generated models from my YaML starting in 'A' crash.
For example generating a model from the following YaML will work fine:
Pguy:
columns:
ptext: string(255)
Likewise:
Zguy:
columns:
ztext: string(255)
will produce models/...
There are 3 tables:
catalog
product
product2catalog
Table product2catalog consists of the following fields:
catalog_id
product_id
How to get goods within the directory? How to rebuild the connection to be able to do so:
$CatalogTable = CatalogTable::getInstance();
$Catalog = $CatalogTable->find( $id );
var_dump( $Catalog->product ...
I wanted to write unit tests for my Zend Framework/Doctrine 2.0 application, but I don't quite understand how to set up unit testing in ZF. Also, I would like to include Doctrine 2.0 in those unit tests. How would I go about setting this up? Can you point me to an example?
Thank You
...
Hi,
Does anyone here use Zend Framework, ZFDoctrine and PHPUnit together?
How to rebuild the database on each test run?
How to separate local/production/testing environments?
Would you share your unit testing setup?
I have been trying something like that:
// /tests/bootstrap.php
// ... setup paths and constants here
require_once 'Ze...
I have a DB (yes, that one) which is proving far easier to access via views than raw tables. In general this plays quite nicely with Doctrine, but there's one issue. Doctrine can't identify a primary key in a view table when generating the YAML from the database schema, so it invents one called 'id'. Generating classes from this means th...
Hi everybody,
I come from a Codeigniter MVC background that we've been working with for some time now. It's time to roll our own framework for a big project, but we have come now to the Database part and got a bit confused immediately.
In Codeigniter, we've used the ActiveRecord for all SQL database connections, which has worked well, b...
I am using Doctrine::generateModelsFromYaml(). It creates a directory filled with base classes. Cool. I'm guessing the point of separating the base classes is to store only column definitions and relationships (in other words, only things that can be gleamed from the DB. The extension models, on the other hand, will be edited with behavi...
When using Doctrine::generateYamlFromDb(), can I specify a prefix to use?
For example, if the table name is "user", by default, the generated class name would be "User". Can I make sure the class name (and filename) is "PrefixUser"?
...
Doctrine_Core::createTablesFromModels() is failing with the following error:
Fatal error: Uncaught exception 'Doctrine_Connection_Mysql_Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'newmexicocreates.address_type' doesn't exist. Failing Query: "SELECT a.id AS a__id, a.title AS a__title FROM address_...
I'm wondering what's the best, the cleanest and the most simply way to work with many-to-many relations in Doctrine2.
Let's assume that we've got an album like Master of Puppets by Metallica with several tracks. But please note the fact that one track might appears in more that just one album like Battery by Metallica does - three albu...
Hi Volks,
I have a weird problem with my i18n doctrine schema and i.a. the admin generator.
(Please look at the edit part below first)
The schema looks like:
CargoSize:
connection: doctrine
actAs:
Timestampable: ~
I18n:
fields: [name, linkname, seoname, description]
tableName: com_cargo_size...