| @@ 549-560 (lines=12) @@ | ||
| 546 | $name, |
|
| 547 | $require_construction_to_be_finalized |
|
| 548 | ); |
|
| 549 | if (! $subsection instanceof EE_Form_Section_Proper) { |
|
| 550 | throw new EE_Error( |
|
| 551 | sprintf( |
|
| 552 | esc_html__( |
|
| 553 | "Subsection '%'s is not an instanceof EE_Form_Section_Proper on form '%s'", |
|
| 554 | 'event_espresso' |
|
| 555 | ), |
|
| 556 | $name, |
|
| 557 | get_class($this) |
|
| 558 | ) |
|
| 559 | ); |
|
| 560 | } |
|
| 561 | return $subsection; |
|
| 562 | } |
|
| 563 | ||
| @@ 2284-2295 (lines=12) @@ | ||
| 2281 | } |
|
| 2282 | } else { |
|
| 2283 | // this thing doesn't exist in the DB, so just cache it |
|
| 2284 | if (! $otherObjectModelObjectOrID instanceof EE_Base_Class) { |
|
| 2285 | throw new EE_Error( |
|
| 2286 | sprintf( |
|
| 2287 | esc_html__( |
|
| 2288 | 'Before a model object is saved to the database, calls to _add_relation_to must be passed an actual object, not just an ID. You provided %s as the model object to a %s', |
|
| 2289 | 'event_espresso' |
|
| 2290 | ), |
|
| 2291 | $otherObjectModelObjectOrID, |
|
| 2292 | get_class($this) |
|
| 2293 | ) |
|
| 2294 | ); |
|
| 2295 | } |
|
| 2296 | $otherObject = $otherObjectModelObjectOrID; |
|
| 2297 | $this->cache($relationName, $otherObjectModelObjectOrID, $cache_id); |
|
| 2298 | } |
|