コード例 #1
0
    /**
     * Deletes all associated AssetModels
     * @return void
     */
    public function DeleteAllAssetModels()
    {
        if (is_null($this->intCategoryId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateAssetModel on this unsaved Category.');
        }
        // Get the Database Object for this Class
        $objDatabase = Category::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (AssetModel::LoadArrayByCategoryId($this->intCategoryId) as $objAssetModel) {
                $objAssetModel->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`asset_model`
				WHERE
					`category_id` = ' . $objDatabase->SqlVariable($this->intCategoryId) . '
			');
    }
コード例 #2
0
ファイル: CategoryGen.class.php プロジェクト: heshuai64/einv2
 /**
  * Gets all associated AssetModels as an array of AssetModel objects
  * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
  * @return AssetModel[]
  */
 public function GetAssetModelArray($objOptionalClauses = null)
 {
     if (is_null($this->intCategoryId)) {
         return array();
     }
     try {
         return AssetModel::LoadArrayByCategoryId($this->intCategoryId, $objOptionalClauses);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
 }