Using Doctrine, I am trying to delete records in a single table based on data gathered from multiple tables.
'companies_groups' is an association table linking 'companies' to 'groups'. I want to delete all records in this table linked to a specific company, with the restriction that only 'companies_groups' records linked to a 'public' g...
Hi there,
I have some models witch are using Doctrine nestedset feature.
I want to add delete functionaly of elements from tree since that is required in my application. I was trying with snippets from documentation but I am getting a very strange error with that code.
YAML is here: http://pastie.org/820978
And I am trying with this c...
Hello fellow PHPers!
It does not seem like Doctrine 2 has built-in validation. Is this a feature that will be supported in the future? How and where do you validate your Doctrine 2 entities?
Guess I have to write my own validation engine for Doctrine.
thanks
...
For all of you who work with Doctrine, I've a question related to moveAsLastChildOf(). I'm using Doctrine 1.1.6 and Symfony 1.2
I have a nested tree, with lots of elements. I want to delete an element of the tree, so first I have to move all its children (and descendants) to its parent; and then delete it. I do the following:
// Get th...
i am getting
orm:schema-tool => The supplied
configuration uses the annotation
metadata driver. The 'class-dir'
argument is required for this driver.
when i try to follow the doctrine 2.0 alpha (i know its alpha) mini tutorial
i am on windows 7 x64, wamp 2. i ran
php.exe doctrine.php orm:schema-tool --create
...
I'm building a small MVC framewrok for a specific PHP application - using Doctrine as ORM.
I'd like to know what it would be the best practice to manage the frontend Menu.
My application has 3 menus (horizontal menu, left menu, bottom/footer menu) that can be edited by the site Admin (the menu is stored in a Doctrine NestedSet).
Where ...
Hello everybody,
I'm developing a Symfony 1.4 project where one of the tables has the Geographical template.
The present functions can give the distance between two records, but not between records and given coordinates.
How can be implemented such feature in Symfony way?
More specific: I need the records ordered by descending distanc...
I have a table
CREATE TABLE `sob_tags_articles` (
`tag_id` int(11) NOT NULL,
`article_id` int(11) NOT NULL,
`id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=112
And triing to save an object with Doctrine:
$sbTagsArticles = new SobTagsArticles();
$sbTagsArticles->article_id = $pubId;
$sb...
I'm building a chat application with codeigniter and doctrine.
Tables:
- User
- User_roles
- User_available
Relations:
ONE user have MANY roles.
ONE user_available have ONE user.
Users available for chatting will be in the user_available table.
Problem:
I need to get all users in in user_available that hasn't got role_id 7.
So I ...
So I have two tables: X and Y.
The schema.yml looks like:
X:
columns:
something: { type: string(255), notnull: true }
y_id: { type: integer, notnull: true }
relations:
Y: { onDelete: CASCADE, local: y_id, foreign: id, foreignAlias: xs }
Y:
columns:
something: { type: string(255), notnull: true }
And in my XTabl...
It seems that in Symfony 1.4 with Doctrine that when generating auto-increment columns (id) it defaults to bigint. This seems like total overkill and I would just like to default it to an integer instead.
The following produces a primary key column named id that is a bigint
JobeetCategory:
actAs: { Timestampable: ~ }
columns:
...
I'm using Symfony 1.4 and Doctrine.
Let's say I have 2 classes : a Brand and a Product.
When I create a new product in the Admin Generator based admin, I'd like to choose a brand from a dropdown list.
The Admin Generator is doing that for me, automatically creating a sfWidgetFormDoctrineChoice.
The problem is that the brands are order...
Hi,
I'm using Doctrine 1.1.2 as my ORM framework in combination with Zend Framework and a MSSQL server back-end. What I am trying to do is to store a blob to the database, but Doctrine is throwing me errors when I try. The column in the database is of type varbinary(max), and the model in Doctrine is configured as follows:
$this->hasCo...
The API gives the code as:
public function up()
{
$this->addColumn('table_name', 'column_name', 'string', $options);
}
but there's no documentation for what can be included in the options array.
http://www.doctrine-project.org/Doctrine_Migration_Base/1_2#method_addcolumn
...
Is it possible to use aggregate values in Doctrine_RawSql query? Here's what I'm trying to do:
$q = new Doctrine_RawSql();
$q->select('{q.*}, AVG(a.value) AS avg');
$q->from('-- complex from clause');
$q->addComponent('q', 'Question');
However, SQL created by Doctrine leaves only columns from table question and omits aggregate value a...
I'm trying to use auto-generated forms in symfony, but I have troubles finding good up to date articles about customization. One of the most important thing is - queries from / updates to several tables.
Specificaly, example: there's table tblMain and auto-generated class tblMainForm I use. However, column ForeignKey references to tblAd...
I'm totally at a loss with the following schema.yml:
JobeetCategory:
actAs: { Timestampable: ~ }
columns:
name: { type: string(255), notnull: true, unique: true }
JobeetJob:
actAs: { Timestampable: ~ }
columns:
category_id: { type: integer, notnull: true }
type: { type: string(255) }
company: { typ...
Hi,
I'm building a Task in Symfony with Doctrine. I'm getting all the places to make a batch update to a particular field. This has to be done in two languages. I'm using setBaseQuery() to make the JOIN on the query with the language I want.
If I do the following in an action, it works without any problem. However, If I do it in a task...
I have a timestamp field (using the timestampable template) that I want formatted differently in the results for only one SELECT query. Is there a way to pass in a date/time format string in the Doctrine_Query::create() method? Or maybe there's a way with ->setParams() or ->setOptions?
I could format the date in the View using Zend_Da...
Hi,
I want to disable the automatic behaviour of changing the 'updated_at' field when an object is updated. I want to do it manually; or at least, have the posibility to disable it as wanted.
I know I can do this by building my own behaviour as in this great answer. But I was searching for something 'cleaner' modifying a listener of th...