/** * MFGroup constructor. * * @param string $propertyName Name of the property in the object where to save the value. * @param string $magicFieldId Id in the MF. * @param array $subFields An array of 'MFField' or 'MFArray' elements that define the sub-properties of the group. * @param boolean $isDouplicableGroup If the group is duplicable set true. * When a group id duplicable, it will return an array of groups. Else, the first group will be returned. */ public function __construct($propertyName, $magicFieldId, $subFields, $isDouplicableGroup) { parent::__construct($propertyName); $this->magicFieldId = $magicFieldId; $this->subFields = $subFields; $this->isDuplicableGroup = $isDouplicableGroup; }
/** * @param string $propertyName Name of the property. * @param \Closure $customFunction Custom function used to get the value of the property. * This function is guaranteed to be passed the following arguments when called. * '$wpPost' WP_Post, with the wordpress post object. * '$wpPostMeta' array, with the wordpress post object metadata. */ public function __construct($propertyName, $customFunction) { parent::__construct($propertyName); $this->customFunction = $customFunction; }
/** * @param string $propertyName Nombre del field en magic fields. * @param string|\Closure $metaKeyOrClosure Meta slug (meta key) or funcion personalizada para obtener el valor. * @param bool $shouldReset si se deberia hacer un reset al obtener el valor. * A esta funcion se le pasaran los parametros de (WP_Post) $wpPost, y (array) $wpPostMeta. */ public function __construct($propertyName, $metaKeyOrClosure, $shouldReset = true) { parent::__construct($propertyName); $this->shouldReset = $shouldReset; $this->metaKeyOrClosure = $metaKeyOrClosure; }