samples icon indicating copy to clipboard operation
samples copied to clipboard

New project at Respect: samples

Open nickl- opened this issue 11 years ago • 5 comments

@alganet please give ops.

Need to customise labels and create "Easy Pick" issue to promote this project and encourage more contributions. Probably other restrictions would surface posing difficulty as well...

Brilliant idea!!!

@Respect have you all seen the new project? Tell us what you...

nickl- avatar Apr 28 '13 02:04 nickl-

I think about write a sample about Respect/Relational. Would be perfect one about Respect/Rest, but it's more hard to explain with one sample.

@alganet @nickl- what do you think guys?

hussani avatar Apr 28 '13 20:04 hussani

@hussani I say cast novice concerns aside and reach for the skies. Don't worry too much about explaining just do something awesome.

There are no limits, uhm wait aside from using vanilla PHP and only Respect modules of course =) Feel free to mix and match any combination you choose. Looking forward to seeing your mix.

nickl- avatar May 01 '13 18:05 nickl-

We could ship a demo of Respect\Relational working with sqlite! What do you guys think?

alganet avatar May 17 '13 22:05 alganet

Here's a db design we can use covering the usual suspects, and then some.

  • has_one relationship
  • has_many relationship
  • has_many_to_many relationship
  • and then something I picked up on ruby which they refer to as polymorphic relationships, which may require more work but something for happy pandas.

What do you say @Respect ?

panda_base ERD The diagrams live edit link on asciiflow.

nickl- avatar May 18 '13 14:05 nickl-

I guess polymorphic association should be easy following the architecture of the new collection types: https://gist.github.com/alganet/4957800

A mockup of the API (following http://guides.rubyonrails.org/association_basics.html#polymorphic-associations):

use Respect\Data\Collections\Polymorphic;

$mapper->pictures = Polymorphic::on('imageable_id')->pictures;
$mapper->products($mapper->pictures)->fetch();

=D

alganet avatar May 18 '13 17:05 alganet