if
```
class ContentQuery extends ActiveQuery
{
	public function ofType(string $type): ContentQuery
	{
		return $this->andWhere(['type' => $type]);
	}
	
	public function ofTemplate(string $template)
	{
		return $this->andWhere(['template' => $template]);
	}
}	
```

from
```
// @property string $type
// @property string|null $template
class Content extends ActiveRecord
{
	public function rules(): array
	{
		return [
			['type', 'default', 'value' => ContentCategory::TYPE_POST]
		];
	}
}
```

but is getting type from ContentCategory extends ActiveRecord...
```
class ContentCategory extends ActiveRecord
{
	const TYPE_POST = 1;
	const TYPE_PRODUCT = 2;
	
	public function rules(): array
	{
		return [
			[['parent_id', 'type'], 'integer'],
		];
	}
	
	public function afterSave($insert, $changedAttributes)
	{
		parent::afterSave($insert, $changedAttributes);
		
		// If this is an update (not a new record insert) and the 'type' attribute has changed
		if (!$insert && isset($changedAttributes['type']))
		{
			\Yii::$app->db->createCommand()
				->update('{{%content}}', ['type' => $this->type], ['category_id' => $this->id])
				->execute();
		}
	}
}
```

this is ContentQuery
```
class ContentQuery extends ActiveQuery
{
	/**
	* {@inheritdoc}
	* @return Content[]|array
	*/
	public function all($db = null): array
	{
		return parent::all($db);
	}

	/**
	* {@inheritdoc}
	* @return Content|array|null
	*/
	public function one($db = null)//: Leave blank, else error.
	{
		return parent::one($db);
	}
	
	/**
	* Id
	* @return app\models\query\ContentQuery
	*/
	public function id($id): ContentQuery
	{
		return $this->andWhere(['id' => $id]);
	}
	
	/**
	* Type of Product
	* 
	*  TYPE_POST = 1;
	*  TYPE_PRODUCT = 2;
	*/
	public function ofType(string $type): ContentQuery
	{
		return $this->andWhere(['type' => $type]);
	}
	
	public function ofTemplate(string $template)
	{
		return $this->andWhere(['template' => $template]);
	}
	
	/**
	* Status
	*
	* STATUS_DRAFT = 0;
	* STATUS_PUBLISH = 1;
	* STATUS_SOLDOUT = 3;
	*/
	public function published()
	{
		return $this->andWhere(['status' => [Content::STATUS_PUBLISH, Content::STATUS_SOLDOUT]]);
	}
	
	public function draft()
	{
		return $this->andWhere(['status' => Content::STATUS_DRAFT]);
	}
	
	public function soldout()
	{
		return $this->andWhere(['status' => Content::STATUS_SOLDOUT]);
	}
	
	/**
	* Slug
	*/
	public function slug($slug): ContentQuery
	{
		return $this->andWhere(['slug' => $slug]);
	}
	
	/**
	* Filter by Purchase Options
	* @param int $flags bitmask of purchase options to filter by
	* @return self
	*
	* Filter products that have any of the given purchase options enabled.
	* Example:
	*
	*	$query->filterByPurchaseOptions(Product::PURCHASE_OPTIONS_CART);
	*
	* Or combined:
	*
	*	$query->filterByPurchaseOptions(Product::PURCHASE_OPTIONS_CART | 
	*		Product::PURCHASE_OPTIONS_INQUIRE);
	*/
	public function filterByPurchaseOptions(int $flags): self
	{
		// Add condition: (purchase_options & :flags) != 0
		// which means product has at least one of the bits in $flags set.
		 $this->query->andWhere('purchase_options & :flags <> 0')
		 	->setParameter(':flags', $flags);
		 
		 return $this;
	}
	
	/**
	* Filter by Purchase Options Exact
	* @param int $flags
	* @return self
	*
	* Filter products that have *all* the given purchase options flags set.
	*
	* Example:
	*
	*	filterByPurchaseOptionsExact(Product::PURCHASE_OPTIONS_CART | 
	*		Product::PURCHASE_OPTIONS_INQUIRE);
	*
	* will match only products with BOTH CART and INQUIRE enabled.
	*/
	public function filterByPurchaseOptionsExact(int $flags): self
	{
		// Add condition: (purchase_options & :flags) = :flags
		// so all bits in $flags must be set in purchase_options
		$this->query->andWhere('purchase_options & :flags = :flags')
			->setParameter(':flags', $flags);
		
		return $this;
	}
}
```

is type actually a string?	

reason i ask is i think i need to rewrite my ContentQuery