core/libraries/rest_api/controllers/model/Read.php 1 location
|
@@ 513-520 (lines=8) @@
|
| 510 |
|
*/ |
| 511 |
|
public function getEntitiesFromRelation($id, $relation, $request) |
| 512 |
|
{ |
| 513 |
|
if (! $relation->get_this_model()->has_primary_key_field()) { |
| 514 |
|
throw new EE_Error( |
| 515 |
|
sprintf( |
| 516 |
|
__( |
| 517 |
|
// @codingStandardsIgnoreStart |
| 518 |
|
'Read::get_entities_from_relation should only be called from a model with a primary key, it was called from %1$s', |
| 519 |
|
// @codingStandardsIgnoreEnd |
| 520 |
|
'event_espresso' |
| 521 |
|
), |
| 522 |
|
$relation->get_this_model()->get_this_model_name() |
| 523 |
|
) |
core/db_models/relations/EE_Model_Relation_Base.php 1 location
|
@@ 305-307 (lines=3) @@
|
| 302 |
|
if ($model_object_or_id instanceof EE_Base_Class) { |
| 303 |
|
$model_object_id = $model_object_or_id->ID(); |
| 304 |
|
} |
| 305 |
|
if (! $model_object_id) { |
| 306 |
|
throw new EE_Error(sprintf( |
| 307 |
|
__( |
| 308 |
|
"Sorry, we cant get the related %s model objects to %s model object before it has an ID. You can solve that by just saving it before trying to get its related model objects", |
| 309 |
|
"event_espresso" |
| 310 |
|
), |