daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Aug 11th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Node: has many NodeDropIns. Relation set in schema.yml
  2. // NodeDropIn: has one DropIn. Relation set below.
  3. // Dropin: pseudo-model, currently have HtmlDropIn and YoutubeDropIn models (text column in NodeDropIn)
  4.  
  5.     foreach ($this->NodeDropIns as $i => $node_drop_in) {
  6.  
  7.       if (!in_array($node_drop_in->drop_in, $drop_ins_added)) {
  8.           $drop_ins_added[] = $node_drop_in->drop_in;
  9.  
  10.           $node_drop_in->hasOne(
  11.             $node_drop_in->getDropInObject()->getModel() . ' as DropIn',
  12.             array(
  13.               'local'   => 'drop_in_id',
  14.               'foreign' => 'id'
  15.             )
  16.           );
  17.  
  18.           $query = $query->leftJoin(
  19.               sprintf('di.DropIn d__%d ON d__%d.id = di.drop_in_id AND di.drop_in = \'%s\'', $i, $i, $node_drop_in->drop_in)
  20.           );
  21.       }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top