Commit Graph

11 Commits

Author SHA1 Message Date
Bharat Mediratta
a3d904bcba ORM::find_all() now uses null as the default value for offset. 2009-11-26 19:36:57 -08:00
Bharat Mediratta
54be15191b Overload Database_Builder to add merge_where() which takes predefined
where clauses and adds them to the existing query.  Update all
existing queries that take an additional where clause to use it.
2009-11-26 18:47:40 -08:00
Bharat Mediratta
2e420522ec Preliminary work to cut over to Kohana 2.4
- Kohana::log() -> Kohana_Log::add()
- Kohana::config_XXX -> Kohana_Config::instance()->XXX
- Implement View::set_global in MY_View
- Updated Cache_Database_Driver to latest APIs
- ORM::$loaded -> ORM::loaded()
- Updated item::viewable() to use K2.4 parenthesization
2009-11-25 13:22:24 -08:00
Bharat Mediratta
752c857116 Rename ORM_MPTT::is_descendant() to ORM_MPTT::contains() to make the
API a little clearer.  Write a test for it, too.
2009-09-10 10:28:43 -07:00
Bharat Mediratta
dee0abfab9 Use is_descendant() API inside move_to() for clarity. 2009-08-30 15:04:39 -07:00
Bharat Mediratta
b394b0b2c6 Fix the default $orderby to be an associative array in descendants() and children(), thanks Tim! 2009-08-05 11:01:48 -07:00
Bharat Mediratta
e8c57290a2 Change the children and descendants APIs to be more consistent and to
remove Gallery3 concepts from ORM_MPTT.

The following API methods:
  ORM_MPTT::children
  ORM_MPTT::children_count
  ORM_MPTT::descendants
  ORM_MPTT::descendants_count

All now take a $where clause that allow you to pass through additional
field parameters.

old API:
  $album->children(10, 0, "photos")
  $album->children_count("photos")

new API:
  $album->children(10, 0, array("type" => "photos"))
  $album->children_count(array("type" => "photos"))

This gives us a more flexible API and simplifies the code.  While I
was in there, I changed the way we deal with default orderby values so
that we just assign the default value in the function definition,
which allows us to get rid of all conditionals in the implementation
which results in simpler code.
2009-08-05 10:38:53 -07:00
Tim Almdal
187d4b209d Change the children methods on Item_Core and ORM_MPTT in order to
specify a type parameter, so tht we can filter the children based
on type (i.e. album, photo, etc).
In addition, expose the sort order, so that we can specify the order
we want to return the children.
2009-08-05 07:38:35 -07:00
Romain LE DISEZ
23bb6eb7e3 Rename columns that use reserved SQL words : items.left and items.right 2009-07-25 19:06:54 +02:00
Bharat Mediratta
cd907c2b42 Change model_cache::clear() API to clear everything. This prevents
old ORM relationships from hanging around, which was causing problems
when doing MPTT manipulations (resulting in incorrect permission
propagation-- very bad!)
2009-07-17 12:51:27 -07:00
Bharat Mediratta
28b41056e3 Restructure things so that the application is now just another module.
Kohana makes this type of transition fairly straightforward in that
all controllers/helpers/etc are still located in the cascading
filesystem without any extra effort, except that I've temporarily
added a hack to force modules/gallery into the module path.

Rename what's left of "core" to be "application" so that it conforms
more closely to the Kohana standard (basically, just
application/config/config.php which is the minimal thing that you need
in the application directory)

There's still considerable work left to be done here.
2009-05-27 15:07:27 -07:00