Hi,
I'm importing some content into a Nested Tree model, and I'm implementing a Transaction to be sure each object has been saved; and if not, remove it from the tree. I'm using Doctrine 1.1.6.
// Start the transaction
$conn = Doctrine_Manager::connection();
try {
$conn->beginTransaction();
// add it as a child of the suburb
$ob...
I'm using the Searchable behavior in Doctrine to search for products in my catalog. It works great when searching for keywords that do match a product. For example, the keyword "Backpack" returns all products with the word "Backpack" in the title.
However, when a search is done for a keyword that doesn't match a title at all then every...
Hey all, I'm learning Doctrine + Symfony and I may have chosen too complex a data model for my own good.
Here's an overview:
Users create Gizmos.
There are 5 Modules to choose from. Users cannot define new ones, only instantiate them.
A Gizmo has any number of Instances in any order. An Instance has one Module ID.
Instances are config...
Hey there :)
Now that I've read all the DQL docs I still have some doubts, I'm
trying to do some nested condictions in my DQL however playing around
with DQL I can't seem to be able to archive them
To make myself more clear:
I have this DQL query
$q = Doctrine_Query::create()
->select('c.nombre,c.webpage')
->addSe...
$user = Doctrine_Core::getTable('User')
->createQuery('u')
->innerJoin('u.Profile p')
->where('p.username = ?', 'jwage')
->fetchOne();
It looks quite different from SQL which I'm quite used to,especially what does the u mean?
Can someone make it clear by a decent explanation?
...
I have some troubles with Doctrine integration into ZF.
After simple redirect
$this->redirector->setGotoSimple("asd");
Doctrine returns
Doctrine_Connection_Exception: There is no open connection in /Users/insight/Sites/max/library/Doctrine/Manager.php on line 657
if i try to get this "asd" page directly or press f5 at the err...
Techniques: ORM, Doctrine 1.1.6, KohanaPHP
With Doctrine 1.1.6. How do I spread a model over different tables?
Detailed situation:
I have the class Entity which contains an ID, login and password and has one emailaddress, many addresses and some other relations. I have two other classes, Company and Person, which extend Entity. I want...
Task:
columns:
name: string(100)
parent_id: integer
relations:
Parent:
class: Task
local: parent_id
foreign: id
foreignAlias: Subtasks
...
So that the behavior template can be autoloaded when necessary.
I'm confused by the complex settings.
...
So, I'm trying to use Doctrine to retrieve some data. I have some basic code like this:
$conn = Doctrine_Manager::connection(CONNECTION_STRING);
$site = Doctrine_Core::getTable('Site')->find('00024');
echo $site->SiteName;
However, this keeps throwing a SQL error that 'column siteid does not exist'. When I look at the exception the SQ...
It looks like a big mess,how does it work as reference?
http://www.doctrine-project.org/documentation/manual/1_1/en/dql-doctrine-query-language%3Abnf
...
Hi,
Is it possible to craft a wildcard WHERE query with Doctrine, like so:
->where('this_field = ?', ANYTHING);
I'd be using this to build a search query dynamically out of unknown user-selected parameters and therefore would need to have the condition in place but capable of accepting the value "anything".
To add, I can get this to...
This snippet from official website works as expected:
$treeObject = Doctrine::getTable('Category')->getTree();
$rootColumnName = $treeObject->getAttribute('rootColumnName');
foreach ($treeObject->fetchRoots() as $root) {
$options = array(
'root_id' => $root->$rootColumnName
);
foreach($treeObject->fetchTree($options) as $no...
Hi All,
I'm setting up my first symfony project, and am having trouble with the schema. I'm not sure if I'm going about it the right way.
I'm having a problem with two of my classes. I have Clients, which can have many Contacts, one of the contacts needs to be selected as the invoice contact. This is my schema:
NativeClient:
actAs: ...
I'm having trouble crafting a fairly simple query with Doctrine...
I have two arrays ($countries, $cities) and I need to check whether database record values would match any inside either. I'm looking for something like:
->whereIn('country', 'city', $countries, $cities)
... with 'country' being a WHERE IN for $countries and 'city' be...
I have to add a new column and a new table to my database but i dont have access to shell of my server. I changed my YAML file. How can i tell doctrine to "migrate models and database to changed yaml"?
...
I just started to use symfony 1.4 and Doctrine.
(Used 1.0 - 1.2 + Propel a lot before).
I thought to give Doctrine a try, because of the fast and huge
Development process in the past.
Thanks to jwage ;-)
Im using Table Inheritance. This is a small portion of my schema.yml:
Articles:
columns:
id:
type: integer(4)
primary:...
I am looking for the best way to go about testing the following static method (specifically using a Doctrine Model):
class Model_User extends Doctrine_Record
{
public static function create($userData)
{
$newUser = new self();
$newUser->fromArray($userData);
$newUser->save();
}
}
Ideally, I would use...
I want to copy a record with all his relations.
I'm trying with:
$o = Doctrine::getTable('Table')->Find(x);
$copy = $object->copy();
$relations = $o->getRelations();
foreach ($relations as $name => $relation) {
$copy->$relation = $object->$relation->copy();
}
$copy->save();
This code doesn't works, but I think it's on the way.
...
I was wondering how to get this to run. In my application I have a Category table and Product table. I need to have a pager which combines both Categories and Products for display in one list (first categories then products). Is there a way to get this going ? I tried left joining in the pager's query, but doesn't seem to do the trick.
...