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

Location:
sandbox/2.4.1-3/prototype/rest/hypermedia
Files:
2 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            } 
  • sandbox/2.4.1-3/prototype/rest/hypermedia/hypermedia.php

    r6395 r6523  
    3030        } 
    3131    } 
    32  
    33 // functions adopted from http://www.sean-barton.co.uk/2009/03/turning-an-array-or-object-into-xml-using-php/ 
    3432 
    3533    function generateValidXmlFromObj(stdClass $obj, $node_block = 'nodes', $node_name = 'node') { 
Note: See TracChangeset for help on using the changeset viewer.