-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEW: Field formatting API, forward compatibility (#313)
* NEW: field formatting API * Finalising new case sensitivity * Add tests for field formatting * Mark field accessor, formatter internal * Linting * Remove test code * Change notice to warning * Use phpunit notice * Add PHP8 condition to unit test * Generic error check
- Loading branch information
Aaron Carlino
authored
Nov 13, 2020
1 parent
263c924
commit 25f654c
Showing
15 changed files
with
437 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
|
||
namespace SilverStripe\GraphQL; | ||
|
||
use SilverStripe\View\ViewableData; | ||
|
||
interface FieldAccessorInterface | ||
{ | ||
/** | ||
* @param ViewableData $object | ||
* @param $fieldName | ||
* @param array $opts | ||
* @param bool $asObject | ||
* @return mixed | ||
*/ | ||
public function getValue(ViewableData $object, $fieldName, $opts = [], $asObject = false); | ||
|
||
/** | ||
* @param ViewableData $object | ||
* @param $fieldName | ||
* @param $value | ||
* @param array $opts | ||
* @return mixed | ||
*/ | ||
public function setValue(ViewableData $object, $fieldName, $value, $opts = []); | ||
|
||
/** | ||
* @param ViewableData $object | ||
* @param $fieldName | ||
* @param array $opts | ||
* @return string|null | ||
*/ | ||
public function getObjectFieldName(ViewableData $object, $fieldName, $opts = []); | ||
} |
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
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
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
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
Oops, something went wrong.