/** * Get a new SpecField instance * * @param int Class ID * @param int $dataType Data type code (ex: self::DATATYPE_TEXT) * @param int $type Field type code (ex: self::TYPE_TEXT_SIMPLE) * * @return EavField */ public static function getNewInstance($className, $dataType = false, $type = false) { if ($className instanceof EavFieldManager) { $className = $className->getClassName(); } $field = parent::getNewInstance(__CLASS__, $dataType, $type); $field->classID->set(self::getClassID($className)); return $field; }
/** * Get a new SpecField instance * * @param Category $category Category instance * @param int $dataType Data type code (ex: self::DATATYPE_TEXT) * @param int $type Field type code (ex: self::TYPE_TEXT_SIMPLE) * * @return SpecField */ public static function getNewInstance(Category $category, $dataType = false, $type = false) { $specField = parent::getNewInstance(__CLASS__, $dataType, $type); $specField->category->set($category); return $specField; }