public function isReferenced() {
		
		// return flag
		$exists = FALSE;
		
		// get list of references to check
		$references = $this->db->getInverseForeignKeys(static::TABLE_NAME);
		
		foreach ($references as $r) {
			
			// get object property name
			$property = array_search($r->REFERENCED_COLUMN_NAME, static::getBinds());
			
			// count for existing records that references
			$query =
				'SELECT COUNT(*)' .
				' FROM `' . $this->db->escape($r->TABLE_NAME) . '`' .
				' WHERE ' . $this->db->escape($r->COLUMN_NAME) . ' = ?';
			
			$this->db->setQuery($query);
			$count = $this->db->loadCount($this->$property);

			// set flag as true
			if ($count) $exists = TRUE;
			
		}
		
		return $exists;
		
	}
public function isReferenced() {
		
		// return flag
		$exists = FALSE;
		
		// get list of references to check
		$references = $this->db->getInverseForeignKeys(static::TABLE_NAME);
		
		foreach ($references as $r) {
			
			// get object property name
			$property = array_search($r->REFERENCED_COLUMN_NAME, static::getBinds());
			
			// count for existing records that references
			$query =
				'SELECT COUNT(*)' .
				' FROM `' . $this->db->escape($r->TABLE_NAME) . '`' .
				' WHERE ' . $this->db->escape($r->COLUMN_NAME) . ' = ?';
			
			$this->db->setQuery($query);
			$count = $this->db->loadCount($this->$property);

			// set flag as true
			if ($count) $exists = TRUE;
			
		}
		
		return $exists;
		
	}
public function isReferenced ( ) { // return flag $ exists = FALSE ; // get list of references to check $ references = $ this -> db -> getInverseForeignKeys ( static :: TABLE_NAME ) ; foreach ( $ references as $ r ) { // get object property name $ property = array_search ( $ r -> REFERENCED_COLUMN_NAME , static :: getBinds ( ) ) ; // count for existing records that references $ query = 'SELECT COUNT(*)' . ' FROM `' . $ this -> db -> escape ( $ r -> TABLE_NAME ) . '`' . ' WHERE ' . $ this -> db -> escape ( $ r -> COLUMN_NAME ) . ' = ?' ; $ this -> db -> setQuery ( $ query ) ; $ count = $ this -> db -> loadCount ( $ this -> $ property ) ; // set flag as true if ( $ count ) $ exists = TRUE ; } return $ exists ; }
Check if this object has foreign keys that constraint it. Return TRUE in case of
existing constraints.

@return boolean
Check if this object has foreign keys that constraint it . Return TRUE in case of existing constraints .