aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classes/IsisConnector.php26
-rw-r--r--schemas/fbe.yaml8
2 files changed, 24 insertions, 10 deletions
diff --git a/classes/IsisConnector.php b/classes/IsisConnector.php
index db5ac9d..eeedeb7 100644
--- a/classes/IsisConnector.php
+++ b/classes/IsisConnector.php
@@ -282,12 +282,26 @@ class IsisConnector {
*/
public function explodeBrackets($subject) {
preg_match_all('/<[^<>]*>/', $subject, $values);
+ return $this->filterBrackets($values[0]);
+ }
- // Why this doesn't work?
- //$values = preg_replace(array('/</', '/>/'), '', $values);
-
- foreach ($values[0] as $key => $value) {
- $values[$key] = preg_replace(array('/</', '/>/'), '', $value);
+ /**
+ * Filter out brackets from strings.
+ *
+ * @param $values
+ * String (or array filled with strings) to be filtered.
+ *
+ * @result
+ * Filtered string or array.
+ */
+ public function filterBrackets($values) {
+ if (is_array($values)) {
+ foreach ($values as $key => $value) {
+ $values[$key] = $this->filterBrackets($value);
+ }
+ }
+ else {
+ $values = preg_replace(array('/</', '/>/'), '', $values);
}
return $values;
@@ -298,6 +312,7 @@ class IsisConnector {
*
* @param $value
* String to be compared.
+ *
* @return
* True if string has brackets, false otherwise.
*/
@@ -316,6 +331,7 @@ class IsisConnector {
*
* @param $value
* String with values.
+ *
* @return
* Array with values.
*/
diff --git a/schemas/fbe.yaml b/schemas/fbe.yaml
index 1c74e40..c05bd01 100644
--- a/schemas/fbe.yaml
+++ b/schemas/fbe.yaml
@@ -93,10 +93,7 @@ fields:
name: Sinopse/Enredo
repeat: Yes
map:
- # TODO: use relation instead of value type / repeat
- #type: Plot
- type: values
- field: plot
+ type: Plot
26:
name: Assuntos/Voc. Controlado
repeat: Yes
@@ -141,7 +138,7 @@ fields:
f: diálogos
g: adaptado por
h: autoria do texto de locução / redator
- i: baseada # baseada (Inspirada) em, na, no, / romance; obra, peça
+ i: baseada # baseada (Inspirada) em, na, no, / romance; obra, peça # TODO: not a performer field
j: diálogos adicionais
k: supervisão de roteiro
l: enquadração (nomenclatura de época)
@@ -437,6 +434,7 @@ fields:
i: conjuntos/bandas
j: componentes
map:
+ # TODO: type: Music
type: Performers
83:
name: Canção