Ignore:
Timestamp:
06/15/12 14:49:24 (12 years ago)
Author:
acoutinho
Message:

Ticket #2766 - Melhorias e correcoes na api rest, criacao de novo cliente

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.1-3/prototype/rest/hypermedia/collection.php

    r6437 r6523  
    2929    public $type; 
    3030    public $data; 
    31         public $links; 
     31    public $links; 
    3232 
    33     function __construct($config, $className) { 
     33    function __construct($config, $className, $id = null) { 
    3434        foreach ($config as $key => $value) { 
    3535            if ($value['class'] == $className) { 
    36                 $uri = $key; 
     36                $uri = ($id ? (preg_replace('/\/[:][a-zA-Z-0-9]+/', '', $key).'/'.$id ) : $key); 
    3737                break; 
    3838            } 
Note: See TracChangeset for help on using the changeset viewer.