forked from omeka/plugin-ItemRelations
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial first couple of API methods /api/item_relations returns ItemR…
…elations and POST works (without complete validation of records)
- Loading branch information
root
committed
Oct 6, 2014
1 parent
3bd35a7
commit 3eaf7c0
Showing
3 changed files
with
99 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
|
||
class Api_ItemRelationsRelation extends Omeka_Record_Api_AbstractRecordAdapter | ||
{ | ||
// Get the REST representation of a record. | ||
public function getRepresentation(Omeka_Record_AbstractRecord $record) | ||
{ | ||
return $record; | ||
// Return a PHP array, representing the passed record. | ||
} | ||
|
||
// Set data to a record during a POST request. | ||
public function setPostData(Omeka_Record_AbstractRecord $record, $data) | ||
{ | ||
//echo "data"; | ||
//echo var_dump($data); | ||
//echo $data -> subject_item_id; | ||
// Set properties directly to a new record.a | ||
$record->subject_item_id = $data->subject_item_id; | ||
$record->object_item_id = $data->object_item_id; | ||
$record->property_id = $data->property_id; | ||
} | ||
|
||
// Set data to a record during a PUT request. | ||
public function setPutData(Omeka_Record_AbstractRecord $record, $data) | ||
{ | ||
// Set properties directly to an existing record. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters