/**
  * Use this rather than the constructor directly
  * to allow alternative implementations.
  *
  * @since 2012-11-29
  */
 public static function newFromContext(IContextSource $context, MessageCollection $collection, MessageGroup $group)
 {
     $table = new self($collection, $group);
     $table->setContext($context);
     Hooks::run('TranslateMessageTableInit', array(&$table, $context, $collection, $group));
     return $table;
 }
Example #2
0
 public static function plant($mixedId, $mixedKind = "WP_Post", $dataset = array())
 {
     $tree = new self();
     $tree->setQuerier(Strata::I18n()->query());
     $tree->setContext($mixedId, $mixedKind);
     $tree->populate($dataset);
     return $tree;
 }
 /**
  * {@inheritdoc}
  */
 public static function fromArray(array $values)
 {
     $message = new self();
     $values = array_merge(['context' => null], $values);
     $message->setContext($values['context']);
     return $message;
 }