| @@ 5947-5956 (lines=10) @@ | ||
| 5944 | */ |
|
| 5945 | public function get_IDs($model_objects, $filter_out_empty_ids = false) |
|
| 5946 | { |
|
| 5947 | if (! $this->has_primary_key_field()) { |
|
| 5948 | if (WP_DEBUG) { |
|
| 5949 | EE_Error::add_error( |
|
| 5950 | __('Trying to get IDs from a model than has no primary key', 'event_espresso'), |
|
| 5951 | __FILE__, |
|
| 5952 | __FUNCTION__, |
|
| 5953 | __LINE__ |
|
| 5954 | ); |
|
| 5955 | } |
|
| 5956 | } |
|
| 5957 | $IDs = array(); |
|
| 5958 | foreach ($model_objects as $model_object) { |
|
| 5959 | $id = $model_object->ID(); |
|
| @@ 5960-5975 (lines=16) @@ | ||
| 5957 | $IDs = array(); |
|
| 5958 | foreach ($model_objects as $model_object) { |
|
| 5959 | $id = $model_object->ID(); |
|
| 5960 | if (! $id) { |
|
| 5961 | if ($filter_out_empty_ids) { |
|
| 5962 | continue; |
|
| 5963 | } |
|
| 5964 | if (WP_DEBUG) { |
|
| 5965 | EE_Error::add_error( |
|
| 5966 | __( |
|
| 5967 | 'Called %1$s on a model object that has no ID and so probably hasn\'t been saved to the database', |
|
| 5968 | 'event_espresso' |
|
| 5969 | ), |
|
| 5970 | __FILE__, |
|
| 5971 | __FUNCTION__, |
|
| 5972 | __LINE__ |
|
| 5973 | ); |
|
| 5974 | } |
|
| 5975 | } |
|
| 5976 | $IDs[] = $id; |
|
| 5977 | } |
|
| 5978 | return $IDs; |
|
| @@ 643-651 (lines=9) @@ | ||
| 640 | ) { |
|
| 641 | // set the start time for this reg step |
|
| 642 | if (! $this->transaction->set_reg_step_initiated($reg_step->slug())) { |
|
| 643 | if (WP_DEBUG) { |
|
| 644 | EE_Error::add_error( |
|
| 645 | sprintf( |
|
| 646 | __('The "%1$s" registration step was not initialized properly.', 'event_espresso'), |
|
| 647 | $reg_step->name() |
|
| 648 | ), |
|
| 649 | __FILE__, |
|
| 650 | __FUNCTION__, |
|
| 651 | __LINE__ |
|
| 652 | ); |
|
| 653 | } |
|
| 654 | } |
|