jetformbuilder
/
includes
/
compatibility
/
jet-engine
/
generators
/
je-query-object-handlers
/
user-object-handler.php
jetformbuilder
/
includes
/
compatibility
/
jet-engine
/
generators
/
je-query-object-handlers
Last commit date
base-object-handler.php
3 years ago
user-object-handler.php
3 years ago
user-object-handler.php
27 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Compatibility\Jet_Engine\Generators\Je_Query_Object_Handlers; |
| 5 | |
| 6 | |
| 7 | class User_Object_Handler extends Base_Object_Handler { |
| 8 | |
| 9 | public function is_supported( $object ): bool { |
| 10 | return ( $object instanceof \WP_User ); |
| 11 | } |
| 12 | |
| 13 | protected function get_converted( $object ) { |
| 14 | return parent::get_converted( $object->data ); |
| 15 | } |
| 16 | |
| 17 | protected function get_label( $converted, $object ) { |
| 18 | $label = $object->{$this->label_field} ?? ''; |
| 19 | |
| 20 | return $label ? $label : $this->get_value( $converted, $object ); |
| 21 | } |
| 22 | |
| 23 | protected function get_calc( $converted, $object ) { |
| 24 | return $object->{$this->calc_field}; |
| 25 | } |
| 26 | |
| 27 | } |