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