This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.2 » Help with csDoctrineActAsSortablePlugin
Help with csDoctrineActAsSortablePlugin [message #77650] Sat, 02 May 2009 09:46 Go to next message
joelchristopher
Messages: 10
Registered: December 2005
Junior Member
I'm attempting to use plugin csDoctrineActAsSortablePlugin, found here:

http://www.symfony-project.org/plugins/csDoctrineActAsSortab lePlugin

Readme says: Optionally accepts a uniqueBy attribute which will be used on a model with a one-to-many relationship.

I add this attribute to my schema, as directed,... but when rebuilding the model, I'm getting an error that says:

Invalid schema element named "uniqueBy" at path (name_of_model).

Any idea what's wrong?
Re: Help with csDoctrineActAsSortablePlugin [message #77661 is a reply to message #77650 ] Sat, 02 May 2009 19:13 Go to previous messageGo to next message
Rubino  is currently offline Rubino
Messages: 104
Registered: April 2009
Location: Barcelona
Senior Member
Can you post your schema?
It usually means the yml indentation is wrong.


Virtual Machine for Symfony & Zend PHP Framworks
Website: http://www.sipx.ws
Support & Project tracker: http://trac.sipx.ws/projects/show/symfony-vm
Re: Help with csDoctrineActAsSortablePlugin [message #77679 is a reply to message #77650 ] Sun, 03 May 2009 06:51 Go to previous messageGo to next message
joelchristopher
Messages: 10
Registered: December 2005
Junior Member
Here is the schema extract in question:

Projectimage:
  actAs:     [Sortable]
  uniqueBy:  [project_id]
  tableName: projectimage
  columns:
    id:
      type: integer(4)
      primary: true
      autoincrement: true
    project_id:
      type: integer(4)
      notnull: true
    ispublic:
      type: integer(1)
      default: '1'
      notnull: true
    position:
      type: integer(4)
      default: '100'
      notnull: true
    updated_at:
      type: timestamp(25)
      notnull: true
    created_at:
      type: timestamp(25)
      notnull: true
    alt: string(255)
    filepath: string(150)
    caption: string(255)
  relations:
    Project:
      local: project_id
      foreign: id
      type: one
      foreignType: many
Re: Help with csDoctrineActAsSortablePlugin [message #77688 is a reply to message #77679 ] Sun, 03 May 2009 16:29 Go to previous messageGo to next message
Rubino  is currently offline Rubino
Messages: 104
Registered: April 2009
Location: Barcelona
Senior Member
I've not used the plugin but I would expect the top section in the schema to be:

  
  actAs:
    Sortable:
      uniqueBy:  [project_id]


otherwise:

  
  actAs:
    Sortable:
      unique:  true
      fields: [project_id]


It depends on how the plugin author has implemented the extra attributes. The latter is the standard used by other Doctrine plugins ( http://www.doctrine-project.org/documentation/manual/1_1/en/ behaviors#core-behaviors:sluggable)

[Updated on: Sun, 03 May 2009 16:34]


Virtual Machine for Symfony & Zend PHP Framworks
Website: http://www.sipx.ws
Support & Project tracker: http://trac.sipx.ws/projects/show/symfony-vm
Re: Help with csDoctrineActAsSortablePlugin [message #77699 is a reply to message #77650 ] Mon, 04 May 2009 01:55 Go to previous messageGo to next message
joelchristopher
Messages: 10
Registered: December 2005
Junior Member
The indentation you posted in the first block seems to have fixed the problem -- thanks Rubino!

J

Re: Help with csDoctrineActAsSortablePlugin [message #98081 is a reply to message #77650 ] Mon, 26 April 2010 22:20 Go to previous messageGo to next message
mchojrin  is currently offline mchojrin
Messages: 36
Registered: February 2009
Location: Buenos Aires, Argentina
Member
Hi:

I'm trying to use this plugin in a Symfony 1.4.4 project and the symfony plugin:install script won't allow it because of a version missmatch. Is there a way I can use it? Or any other similar plugin for that matters?

I have tried the doctrine extension by itself, but I think I'll be doing extra work... Thanks!
Re: Help with csDoctrineActAsSortablePlugin [message #98150 is a reply to message #98081 ] Tue, 27 April 2010 15:31 Go to previous messageGo to next message
mchojrin  is currently offline mchojrin
Messages: 36
Registered: February 2009
Location: Buenos Aires, Argentina
Member
mchojrin wrote on Mon, 26 April 2010 17:20

Hi:

I'm trying to use this plugin in a Symfony 1.4.4 project and the symfony plugin:install script won't allow it because of a version missmatch. Is there a way I can use it? Or any other similar plugin for that matters?

I have tried the doctrine extension by itself, but I think I'll be doing extra work... Thanks!


I have just been able to use this plugin by manually installing the source into my code and using the indentation described here... the documentation is not very clear on this... also, why is this plugin restricted up to sf 1.3? I read this in the package.xml file
Re: Help with csDoctrineActAsSortablePlugin [message #98163 is a reply to message #77650 ] Tue, 27 April 2010 17:35 Go to previous message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
If a plugin that works for 1.3 will also work for 1.4, please raise a ticket to get the package.xml file changed, or contact the developer.


Remember Palestine
Previous Topic:import excel
Next Topic:Strict Standards: Non-static method error
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software