-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
121 additions
and
10 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace studioespresso\exporter\fields; | ||
|
||
class FormieNameParser extends BaseFieldParser | ||
{ | ||
/** | ||
* @param $element | ||
* @param \verbb\formie\fields\formfields\Name $field | ||
* @return mixed | ||
* @throws \craft\errors\InvalidFieldException | ||
*/ | ||
public function getValue($element, $field) | ||
{ | ||
$value = $element->getFieldValue($field['handle']); | ||
/** @phpstan-ignore-next-line */ | ||
if (is_object($value) && get_class($value) === verbb\formie\models\Name::class) { | ||
$string = ''; | ||
if ($value->prefix) { | ||
$string = $string . $value->prefix . " "; | ||
} | ||
if ($value->firstName) { | ||
$string = $string . $value->firstName . " "; | ||
} | ||
if ($value->lastName) { | ||
$string = $string . $value->lastName; | ||
} | ||
return $string; | ||
} | ||
return $value; | ||
} | ||
|
||
public function getOptions(): array | ||
{ | ||
return []; | ||
} | ||
|
||
public function getOptionType(): string|bool | ||
{ | ||
return false; | ||
} | ||
|
||
protected function getOptionLabel(): string|bool | ||
{ | ||
return false; | ||
} | ||
|
||
protected function getOptionDescription(): string|bool | ||
{ | ||
return false; | ||
} | ||
} |
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