/** * Part constructor * * @param AbstractMultipartHydrator $hydrator * @param array $template Subpart template * @param array|int $minOccurrences Minimum occurrences * @param int $maxOccurrences Maximum occurrences */ public function __construct(AbstractMultipartHydrator $hydrator, array $template, $minOccurrences = 1, $maxOccurrences = 1) { self::validateOccurrences($minOccurrences, $maxOccurrences); $this->template = $template; $this->minimumOccurrences = intval($minOccurrences); $this->maximumOccurrences = intval($maxOccurrences); parent::__construct($hydrator); // Initialize the occurrences $this->initializeOccurrences($this->minimumOccurrences); }
/** * Part constructor * * @param AbstractSinglepartHydrator $hydrator Associated hydrator * @param string $content Part content */ public function __construct(AbstractSinglepartHydrator $hydrator, $content = '') { parent::__construct($hydrator); $this->content = $content; }