| @@ 2287-2298 (lines=12) @@ | ||
| 2284 | } |
|
| 2285 | } else { |
|
| 2286 | //this thing doesn't exist in the DB, so just cache it |
|
| 2287 | if (! $otherObjectModelObjectOrID instanceof EE_Base_Class) { |
|
| 2288 | throw new EE_Error( |
|
| 2289 | sprintf( |
|
| 2290 | esc_html__( |
|
| 2291 | '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', |
|
| 2292 | 'event_espresso' |
|
| 2293 | ), |
|
| 2294 | $otherObjectModelObjectOrID, |
|
| 2295 | get_class($this) |
|
| 2296 | ) |
|
| 2297 | ); |
|
| 2298 | } |
|
| 2299 | $otherObject = $otherObjectModelObjectOrID; |
|
| 2300 | $this->cache($relationName, $otherObjectModelObjectOrID, $cache_id); |
|
| 2301 | } |
|
| @@ 515-526 (lines=12) @@ | ||
| 512 | $name, |
|
| 513 | $require_construction_to_be_finalized |
|
| 514 | ); |
|
| 515 | if (! $subsection instanceof EE_Form_Section_Proper) { |
|
| 516 | throw new EE_Error( |
|
| 517 | sprintf( |
|
| 518 | esc_html__( |
|
| 519 | "Subsection '%'s is not an instanceof EE_Form_Section_Proper on form '%s'", |
|
| 520 | 'event_espresso' |
|
| 521 | ), |
|
| 522 | $name, |
|
| 523 | get_class($this) |
|
| 524 | ) |
|
| 525 | ); |
|
| 526 | } |
|
| 527 | return $subsection; |
|
| 528 | } |
|
| 529 | ||