OpenBuildings / jam-tart

Jam Admin Builder
BSD 3-Clause "New" or "Revised" License
1 stars 2 forks source link

Drag n drop sort #14

Closed vkuzmov closed 10 years ago

vkuzmov commented 10 years ago

In all tart controllers: data-sort-url assigned to tart table should point to the new action_reorder in tart modify controller

Replace ->attributes('data-sort-url', Tart::uri('modify', array('controller' => 'modify', 'action' => 'move')) With ->attributes('data-sort-url', Tart::uri('modify', array('controller' => 'modify', 'action' => 'reorder'))

yanev commented 10 years ago

@vkuzmov the build failed for some reason, maybe you should just run build process again. When its fixed, LGTM image

vkuzmov commented 10 years ago

@yanev The method sort_ids does not exist on object? Since you implemented __call, maybe consider adding a @method annotation.

I think you need to update Jam module. It rely on builder_call_sort_ids() method in sortable behavior.

hkdobrev commented 10 years ago

@vkuzmov There is no easy solution for this warning from the PHP Analyzer unfortunately.

There is just too much magic:

  1. Behavior could attach methods to the model with model_call_ and builder_call_ prefixes. So let's say you could make the effort to document every magic model method with the @method annotation in every model where the behavior is attached. You could also document the magic methods on the builder in the Model_Collection_ classes. If you don't have Model_Collection_ class for the model you cannot document the magic builder methods at all for analyzer.
  2. Here Jam::all() is used which would always return a Jam_Query_Builder_Collection instance. But you don't know which Model_Collection_ instance that would be (if any). That's because this is determined on-the-fly from the string passed to the Jam::all() method.