public function __construct($propertyName, Entity\Reflection $sourceReflection, Entity\Reflection $targetReflection, array $mapBy) { parent::__construct($propertyName, $sourceReflection, $targetReflection, $mapBy); if (!isset($mapBy[0])) { throw new Exception\AssociationException("You must define referenced key!"); } }
/** * Load default decorators * * Disables "for" attribute of label if label decorator enabled. * * @return \Zend\Form\Element\Radio */ public function loadDefaultDecorators() { if ($this->loadDefaultDecoratorsIsDisabled()) { return $this; } parent::loadDefaultDecorators(); $this->addDecorator('Label', array('tag' => 'dt', 'disableFor' => true)); return $this; }
/** * @param array $config * @return Multi */ public function create(array $config) { $filtre = new Multi(); if (isset($config['nom'])) { $filtre->setNom($config['nom']); } if (isset($config['critere'])) { $critereLst = array(); foreach ($config['critere'] as $key => $critereConfig) { if (!isset($critereConfig['id'])) { $critereConfig['id'] = $key; } $critere = CritereFactory::create($critereConfig); $critereLst[$key] = $critere; } $filtre->setCritereLst($critereLst); } return $filtre; }
public function __construct($propertyName, Entity\Reflection $sourceReflection, Entity\Reflection $targetReflection, array $mapBy, $dominant = true) { parent::__construct($propertyName, $sourceReflection, $targetReflection, $mapBy, $dominant); if (!$targetReflection->hasPrimary()) { throw new Exception\AssociationException("Target entity must have defined primary when M:N relation used!"); } if (!isset($mapBy[0])) { throw new Exception\AssociationException("You must define join key!"); } if (!isset($mapBy[1])) { throw new Exception\AssociationException("You must define join resource!"); } if (!isset($mapBy[2])) { throw new Exception\AssociationException("You must define referencing key!!"); } }
public function testCheckArrayLengthsExceptionOnlyOneArray() { $this->setExpectedException('\\MathPHP\\Exception\\BadDataException'); Multi::add([1, 2]); }
*/ $contacts = array("18*********", "15*********"); foreach ($contacts as $contact) { $multi = new Multi(); $multi->setTo($contact); $multi->addVar("code", rand(00, 999999)); $submail->addMulti($multi->build()); } /* |multi 参数示例三 |多文本变量示例(以下示例为模板中包含@var(name),@var(code1),@var(code2)分别对应联系人的三个文本变量) |-------------------------------------------------------------------------- */ $contacts = array(array("to" => "18*********", "vars" => array("name" => "jack", "code1" => "FAD62979791", "code1" => "FAD62979792")), array("to" => "15*********", "vars" => array("name" => "tom", "code1" => "FAD62979793", "code1" => "FAD62979794"))); foreach ($contacts as $contact) { $multi = new Multi(); $multi->setTo($contact['to']); foreach ($contact['vars'] as $key => $value) { $multi->addVar($key, $value); } $submail->addMulti($multi->build()); } /* |必选参数 |-------------------------------------------------------------------------- |设置短信模板ID |-------------------------------------------------------------------------- */ $submail->SetProject('2glEg1'); /* |调用 multixsend 方法发送短信