Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Preview of next release (0.7)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alvaro Carrasco  
View profile  
 More options Jan 21, 1:03 am
From: Alvaro Carrasco <alv...@epliant.com>
Date: Tue, 20 Jan 2009 23:03:22 -0700
Local: Wed, Jan 21 2009 1:03 am
Subject: Preview of next release (0.7)
Fellow outlet users,

I have been working hard on the next release of outlet. Since a lot of
the changes I was making were sort of experimental, I created a branch
to work on them: the 'many-to-many' branch.

The main features are:
* One-to-one and many-to-many relationships
* PHP-5.2's DateTime support
* Fluent-interface query API
* Eager fetching

The code currently passes the unit tests, but I feel it still needs some
polish.

There is one BC-incompatible change that was necessary to implement
many-to-many relationships without creating a linking entity in code:
Collections.

On this new version, relationship methods that currently return an array
of entities will now return a Collection object. This object implements
extends ArrayObject so it can be used in most situations where an array
can be used. Here is an example:

<?php

// entities should now be defined like this
class Project {
  private $bugs;
  ...
  public function getBugs () {
    return $this->bugs;
  }
  public function setBugs(Collection $bugs) {
    $this->bugs = $bugs;
  }
  ...

}

// notice that you no longer need the addBug() method

...

$bugs = $project->getBugs();

// bugs is an instance of Collection
// but it behaves just like an array

// you can call count it
echo count($bugs);

// and you can use it in a foreach
foreach ($bugs as $bug) {
  echo $bug->Description;

}

// to add a bug to a project
$bug = new Bug;
$bug->Title = 'Test Bug';

// you no longer need an addBug method
$project->getBugs()->add($bug);

// bug if you create it, you can still use it just the same
$project->addBug( $bug );

?>

Everything else works the same.

I would really appreciate any feedback on these changes, so if you're
adventurous, please check it out:

svn://knowledgehead.com/outlet/branches/many-to-many

Thanks,
Alvaro


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google