I'm trying to set a Doctrine attribute in a task, but it doesn't seem to work.
What I'm trying to set, is an attribute to disable Doctrine validation:
$databaseManager = new sfDatabaseManager($this->configuration);
$connection = $databaseManager->getDatabase('doctrine')->getConnection();
$connection->setAttribute(Doctrine_Core::ATTR_VA...
I have a number of tables that will be looked up using the url 'slug'. For example 'news' and 'blog' both have the 'slug' field, which is defined as a unique field in the doctrine database schema.
Is there any way I can extend this uniqueness across both tables: for example if there is a news article with slug= "good-story" then it will...
symfony 1.2, doctrine, dsn: sqlite:%sf_data_dir%/db.sq3
When i am trying "php symfony dctrine:build-sql" i get this error, but on frontend all fine.
Also i have tried to change ini file this way
php -c "path to file" symfony doctrine:build-sql
but get the same error
Couldn't locate driver named sqlite
...
ZF has a very nice feature which is called findManyToManyRowset which returns you directly a collection of objects from a MN connection. The whole purpose of MN is to get the information from the other table, not from the connection table.
We have this schema:
- users
- id
- name
- groups
- id
- name
- user_has_groups
- use...
I'm using symfony 1.4 with doctrine as my ORM, I need to do one of two thing to get it working, and I don't know how to do it. If anyone can help me please do :-P
the id fields should not be bigint, just int or
When I define my table as follows:
Table:
columns:
id:
type: integer
autoincrement: true
primary: true
make th...
Hi,
I'm using the symfony plugin sfDoctrineActAsTaggablePlugin to add a Taggable behaviour to some objects of my model.
I followed the instruction given here but when I want to save a taggable element in the database I get :
Unknown record property / related component "saved_tags" on "Mishidea"
Mishidea is the name of the class/tabl...
Following Models:
class User extends Doctrine_Record {
public function setTableDefinition() {
$this->hasColumn ( 'iron', 'integer', 4 );
}
public function setUp() {
$this->hasMany ('Field as Fields', array(
'local' => 'id',
'foreign' => 'owner_id'
));
}
}
class Field exte...
Hi,
I want to attribute some tags to some of the objects of my doctrine model.
I found sfDoctrineActAsTaggablePlugin which seems to be precisely what I need.
The problem is that when I want to save a Taggable object, I get this error:
Unknown record property / related component "saved_tags" on "Mishidea"
Mishidea is the name of the...
Hello,
Hello I have a little problem with requests : In an action executeFiche, I have three requests
public function executeFiche(sfWebRequest $request){
// Récupération du logement correspondant à l'ID passé dans l'URL
$this->forward404Unless($this->logement = Doctrine::getTable('Logement')->find(array($request->getParameter('...
The title says it all.
I want to set the start value for auto increment on a column to 1000000 (to avoid conflicts with a legacy application), but can't find any documentation that tells me how.
Pretty standard table, here's what the relevant bit looks like:
User:
attributes:
export: tables
columns:
id:
type: inte...
I am using an alias in my select clause ("AVG(u.rating) as avg_rating") and would then like to add this in my where clause "avg_rating > 3" but when I try and run this query I get a "Unknown column 'u3__1' in 'where clause'." Does anyone happen to know how I can get my where clause to see the alias? This alias works in the orderBy with ...
I'm pretty new to Doctrine, but as I understand it, the assignIdentifier() method is supposed to tell Doctrine to update the relevant row into the database instead of inserting a new one.
I have an object that I'm building through a workflow, so the identifier has an id of null until I call $object->save(); which inserts it, and this do...
I'm building an app for the company I work for in symfony, non the less the app might be pretty useful outside our company so we decided to write it in a more general form so we can make it multi company. I'm facing a problem on how to define a default value for a field that is going to be in every single model (company_id) so we don't ...
I have a Doctrine_Collection object that was created with code that looks something like.
$collection = Doctrine_Query::create()
->from('FooBazBar')
->where('widget_id = ?',$some_var)
->execute();
Short of writing it down somewhere, is it possible to to retrieve the where clause that was used to create the collection?
That is, I want...
I have two objects: File and FileDetail. A File can have many FileDetails, but a FileDetail can only have one File. I can get this to work, but I can't delete anything from the database because of key constraints (I can't delete the File row because FileDetail depends on it, and vice versa). I have the following yaml:
File:
columns:
...
Hi,
In my database, the user management is divided into two tables:
- One created by the symfony sfDoctrineGuard plugin (sfGuardUser), with the username, the password and other information used by the plugin
- another one that I created to extend this table with more properties such as the firstname, surname etc...
What I want to do is...
Can we have a model class which is singleton in Doctrine?
For Singleton classes I should have a private/protected constructor....but this is not possible as I am extending a Doctrine class which has a public constructor
You can argue about the use of the Singleton pattern when interacting with the DB, but just consider this scenario:
...
How should be implemented facultative one-to-one relation in Doctrine ORM and Symfony? Suppose there are some folders represented in database. Each folder can have a default icon or some custom icon represented in another table. How should this relation be described in the schema file? How can I tell that in case of given folder relation...
Hi all :)
In my symfony project i'm working with doctrine for my data models. Also i have the sfMasterSlavePlugin installed to use different connections for different kinds of queries (writes vs. reads).
Because of the small delay in mysql's replication my code is failing to fetch a freshly inserted record. To get around this problem i...
I'm trying to load data from fixtures jobs.yaml and categories.yaml with this command:
$ php symfony doctrine:data-load
But the tables are empty. I have got the columns and tables created, but no data loaded.
It returns:
doctrine Loading data fixtures from "./jobeet/data/fixtures"
doctrine Data was successfully loaded
And the so...