Пример #1
0
    /**
     * Deletes all associated ManufacturersAsModifiedBy
     * @return void
     */
    public function DeleteAllManufacturersAsModifiedBy()
    {
        if (is_null($this->intUserAccountId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateManufacturerAsModifiedBy on this unsaved UserAccount.');
        }
        // Get the Database Object for this Class
        $objDatabase = UserAccount::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (Manufacturer::LoadArrayByModifiedBy($this->intUserAccountId) as $objManufacturer) {
                $objManufacturer->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`manufacturer`
				WHERE
					`modified_by` = ' . $objDatabase->SqlVariable($this->intUserAccountId) . '
			');
    }
Пример #2
0
 /**
  * Gets all associated ManufacturersAsModifiedBy as an array of Manufacturer objects
  * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
  * @return Manufacturer[]
  */
 public function GetManufacturerAsModifiedByArray($objOptionalClauses = null)
 {
     if (is_null($this->intUserAccountId)) {
         return array();
     }
     try {
         return Manufacturer::LoadArrayByModifiedBy($this->intUserAccountId, $objOptionalClauses);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
 }