Ejemplo n.º 1
0
 private function mapResource($entities, $options = array())
 {
     $Resource = new AkResource($entities, $options);
     $Resource->setMap($this->Router);
     $Map = $Resource->getMap(array('controller' => $Resource->getController()));
     $this->mapCollectionActions($Map, $Resource);
     $this->mapDefaultCollectionActions($Map, $Resource);
     $this->mapAddActions($Map, $Resource);
     $this->mapMemberActions($Map, $Resource);
     $this->mapAssociations($Resource, $options);
     $Map->options = Ak::pick($this->_inheritable_options, $Map->options);
     $Map->options = array_merge(array('path_prefix' => $Resource->getNestingPathPrefix(), 'name_prefix' => $Resource->getNestingNamePrefix()), $Map->options);
     return $Map;
 }
Ejemplo n.º 2
0
 public function test_should_resource_controller_name_equal_controller_option()
 {
     $Resource = new AkResource('messages', array('controller' => 'posts'));
     $this->assertEqual('messages', $Resource->getController());
 }