/** * Get ALL options, including unassigned */ public static function getOptions($option_table, $option_phrase_field, $intersection_table, $parent_table) { $tableObj = new MultiAssignList(array('name' => $option_table)); $select = $tableObj->select()->setIntegrityCheck(false)->from(array('o' => $option_table), array('id', $option_phrase_field))->joinLeft(array('i' => $intersection_table), "i.{$option_table}_id = o.id AND o.is_deleted = 0", array("{$parent_table}_id"))->where("o.is_deleted = 0")->order($option_phrase_field); return $tableObj->fetchAll($select)->ToArray(); }