DonorMetaKeys.php
46 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Donors\ValueObjects; |
| 4 | |
| 5 | use Give\Framework\Support\ValueObjects\Enum; |
| 6 | use Give\Framework\Support\ValueObjects\EnumInteractsWithQueryBuilder; |
| 7 | |
| 8 | /** |
| 9 | * @since 2.19.6 |
| 10 | * |
| 11 | * @method static FIRST_NAME() |
| 12 | * @method static LAST_NAME() |
| 13 | * @method static ADDITIONAL_EMAILS() |
| 14 | * @method static PREFIX() |
| 15 | */ |
| 16 | class DonorMetaKeys extends Enum |
| 17 | { |
| 18 | use EnumInteractsWithQueryBuilder; |
| 19 | |
| 20 | const FIRST_NAME = '_give_donor_first_name'; |
| 21 | const LAST_NAME = '_give_donor_last_name'; |
| 22 | const ADDITIONAL_EMAILS = 'additional_email'; |
| 23 | const PREFIX = '_give_donor_title_prefix'; |
| 24 | |
| 25 | /** |
| 26 | * @since 2.24.0 change function to remove ADDITIONAL_EMAILS from columns |
| 27 | * |
| 28 | * @return array |
| 29 | */ |
| 30 | public static function getColumnsForAttachMetaQueryWithoutAdditionalEmails() |
| 31 | { |
| 32 | $columns = self::getColumnsForAttachMetaQuery(); |
| 33 | |
| 34 | |
| 35 | $id = array_search( |
| 36 | [self::ADDITIONAL_EMAILS, self::ADDITIONAL_EMAILS()->getKeyAsCamelCase()], |
| 37 | $columns, |
| 38 | true |
| 39 | ); |
| 40 | |
| 41 | unset($columns[$id]); |
| 42 | |
| 43 | return $columns; |
| 44 | } |
| 45 | } |
| 46 |