sets and gets metadata on plural
This commit is contained in:
parent
06777f0be9
commit
3a9484cfd6
|
@ -3,6 +3,7 @@
|
|||
namespace Tainacan\API\EndPoints;
|
||||
|
||||
use \Tainacan\API\REST_Controller;
|
||||
use Tainacan\Entities\Metadatum;
|
||||
|
||||
class REST_Metadatum_Mappers_Controller extends REST_Controller {
|
||||
|
||||
|
@ -45,7 +46,7 @@ class REST_Metadatum_Mappers_Controller extends REST_Controller {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param mixed $item
|
||||
* @param Metadatum $item
|
||||
* @param \WP_REST_Request $request
|
||||
*
|
||||
* @return array|\WP_Error|\WP_REST_Response
|
||||
|
@ -54,7 +55,7 @@ class REST_Metadatum_Mappers_Controller extends REST_Controller {
|
|||
if(!empty($item)){
|
||||
$item_arr = $item->_toArray();
|
||||
|
||||
$item_arr['metadatum_type_object'] = $item->get_metadatum_type_object()->_toArray();
|
||||
$item_arr['metadatum_type_object'] = $item->get_metadata_type_object()->_toArray();
|
||||
|
||||
return $item_arr;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class TAINACAN_REST_Metadatum_Mappers_Controller extends TAINACAN_UnitApiTestCas
|
|||
'name' => 'test_MetadatumMappers',
|
||||
'description' => 'descricao',
|
||||
'collection' => $collection,
|
||||
'metadatum_type' => $type,
|
||||
'metadata_type' => $type,
|
||||
'exposer_mapping' => [
|
||||
'dublin-core' => 'language'
|
||||
]
|
||||
|
@ -41,7 +41,7 @@ class TAINACAN_REST_Metadatum_Mappers_Controller extends TAINACAN_UnitApiTestCas
|
|||
'name' => 'test_MetadatumMappers2',
|
||||
'description' => 'descricao2',
|
||||
'collection' => $collection,
|
||||
'metadatum_type' => $type
|
||||
'metadata_type' => $type
|
||||
),
|
||||
true,
|
||||
true
|
||||
|
|
Loading…
Reference in New Issue