# Class BAttribute

Attribute is an abstract concept which has two real uses - label (key - value pair) and relation (representing named relationship between source and target note)

#### Hierarchy (View Summary)

- AbstractBeccaEntity < BAttribute >
  - BAttribute

- Defined in src/becca/entities/battribute.ts:18

##### Index

### Constructors

constructor

### Properties

attributeId
blobId?
dateCreated?
dateModified?
isInheritable
isProtected?
isSynced?
name
noteId
position
type
utcDateCreated
utcDateModified?
value

### Accessors

becca
isAffectingSubtree
isDeleted
note
targetNote
targetNoteId
entityName
hashedProperties
primaryKeyName

### Methods

_getContent
_setContent
beforeSaving
createClone
generateHash
getDefinedName
getDefinition
getNote
getPojo
getPojoToSave
getTargetNote
getUtcDateChanged
hasStringContent
init
isAutoLink
isDefinition
markAsDeleted
markAsDeletedSimple
putEntityChange
save
update
updateFromRow
validate

## Constructors

### constructor

- new BAttribute(row?: AttributeRow ): BAttribute

  #### Parameters

  - `Optional` row: AttributeRow

  #### Returns BAttribute

  Overrides AbstractBeccaEntity.constructor

  - Defined in src/becca/entities/battribute.ts:37

## Properties

### attributeId

attributeId: string

- Defined in src/becca/entities/battribute.ts:29

### `Optional` blobId

blobId?: string

Inherited from AbstractBeccaEntity.blobId

- Defined in src/becca/entities/abstract_becca_entity.ts:34

### `Optional` dateCreated

dateCreated?: string

Inherited from AbstractBeccaEntity.dateCreated

- Defined in src/becca/entities/abstract_becca_entity.ts:27

### `Optional` dateModified

dateModified?: string

Inherited from AbstractBeccaEntity.dateModified

- Defined in src/becca/entities/abstract_becca_entity.ts:28

### isInheritable

isInheritable: boolean

- Defined in src/becca/entities/battribute.ts:35

### `Optional` isProtected

isProtected?: boolean

Inherited from AbstractBeccaEntity.isProtected

- Defined in src/becca/entities/abstract_becca_entity.ts:32

### `Optional` isSynced

isSynced?: boolean

Inherited from AbstractBeccaEntity.isSynced

- Defined in src/becca/entities/abstract_becca_entity.ts:33

### name

name: string

- Defined in src/becca/entities/battribute.ts:32

### noteId

noteId: string

- Defined in src/becca/entities/battribute.ts:30

### position

position: number

- Defined in src/becca/entities/battribute.ts:33

### type

type: AttributeType

- Defined in src/becca/entities/battribute.ts:31

### utcDateCreated

utcDateCreated: string

Inherited from AbstractBeccaEntity.utcDateCreated

- Defined in src/becca/entities/abstract_becca_entity.ts:30

### `Optional` utcDateModified

utcDateModified?: string

Inherited from AbstractBeccaEntity.utcDateModified

- Defined in src/becca/entities/abstract_becca_entity.ts:26

### value

value: string

- Defined in src/becca/entities/battribute.ts:34

## Accessors

### `Protected` becca

- get becca(): default

  #### Returns default

  Inherited from AbstractBeccaEntity.becca

  - Defined in src/becca/entities/abstract_becca_entity.ts:47

### isAffectingSubtree

- get isAffectingSubtree(): boolean

  #### Returns boolean

  - Defined in src/becca/entities/battribute.ts:102

### isDeleted

- get isDeleted(): boolean

  #### Returns boolean

  Overrides AbstractBeccaEntity.isDeleted

  - Defined in src/becca/entities/battribute.ts:165

### note

- get note(): BNote

  #### Returns BNote

  - Defined in src/becca/entities/battribute.ts:115

### targetNote

- get targetNote(): undefined | BNote

  #### Returns undefined | BNote

  - Defined in src/becca/entities/battribute.ts:119

### targetNoteId

- get targetNoteId(): undefined | string

  #### Returns undefined | string

  - Defined in src/becca/entities/battribute.ts:106

### `Static` entityName

- get entityName(): string

  #### Returns string

  - Defined in src/becca/entities/battribute.ts:19

### `Static` hashedProperties

- get hashedProperties(): string[]

  #### Returns string[]

  - Defined in src/becca/entities/battribute.ts:25

### `Static` primaryKeyName

- get primaryKeyName(): string

  #### Returns string

  - Defined in src/becca/entities/battribute.ts:22

## Methods

### `Protected`_getContent

- _getContent(): string | Buffer< ArrayBufferLike >

  #### Returns string | Buffer< ArrayBufferLike >

  Inherited from AbstractBeccaEntity._getContent

  - Defined in src/becca/entities/abstract_becca_entity.ts:261

### `Protected`_setContent

- _setContent(content: string | Buffer< ArrayBufferLike >, opts?: ContentOpts ): void

  #### Parameters

  - content: string | Buffer< ArrayBufferLike >
  - opts: ContentOpts = {}

  #### Returns void

  Inherited from AbstractBeccaEntity._setContent

  - Defined in src/becca/entities/abstract_becca_entity.ts:140

### beforeSaving

- beforeSaving(opts?: SavingOpts ): void

  #### Parameters

  - opts: SavingOpts = {}

  #### Returns void

  Overrides AbstractBeccaEntity.beforeSaving

  - Defined in src/becca/entities/battribute.ts:169

### createClone

- createClone(
  type: AttributeType ,
  name: string,
  value: string,
  isInheritable?: boolean,
  ): BAttribute

  #### Parameters

  - type: AttributeType
  - name: string
  - value: string
  - `Optional` isInheritable: boolean

  #### Returns BAttribute

  - Defined in src/becca/entities/battribute.ts:214

### generateHash

- generateHash(isDeleted?: boolean): string

  #### Parameters

  - `Optional` isDeleted: boolean

  #### Returns string

  Inherited from AbstractBeccaEntity.generateHash

  - Defined in src/becca/entities/abstract_becca_entity.ts:63

### getDefinedName

- getDefinedName(): string

  #### Returns string

  - Defined in src/becca/entities/battribute.ts:155

### getDefinition

- getDefinition(): DefinitionObject

  #### Returns DefinitionObject

  - Defined in src/becca/entities/battribute.ts:151

### getNote

- getNote(): BNote

  #### Returns BNote

  - Defined in src/becca/entities/battribute.ts:125

### getPojo

- getPojo(): {
  attributeId: string;
  isDeleted: boolean;
  isInheritable: boolean;
  name: string;
  noteId: string;
  position: number;
  type: AttributeType ;
  utcDateModified: undefined
  | string;
  value: string;
  }

  #### Returns {
  attributeId: string;
  isDeleted: boolean;
  isInheritable: boolean;
  name: string;
  noteId: string;
  position: number;
  type: AttributeType ;
  utcDateModified: undefined | string;
  value: string;
  }

  Overrides AbstractBeccaEntity.getPojo

  - Defined in src/becca/entities/battribute.ts:200

### `Protected` getPojoToSave

- getPojoToSave(): {}

  #### Returns {}

  Inherited from AbstractBeccaEntity.getPojoToSave

  - Defined in src/becca/entities/abstract_becca_entity.ts:78

### getTargetNote

- getTargetNote(): null | BNote

  #### Returns null | BNote

  - Defined in src/becca/entities/battribute.ts:135

### getUtcDateChanged

- getUtcDateChanged(): string

  #### Returns string

  Inherited from AbstractBeccaEntity.getUtcDateChanged

  - Defined in src/becca/entities/abstract_becca_entity.ts:43

### hasStringContent

- hasStringContent(): boolean

  #### Returns boolean

  Inherited from AbstractBeccaEntity.hasStringContent

  - Defined in src/becca/entities/abstract_becca_entity.ts:82

### init

- init(): void

  #### Returns void

  Overrides AbstractBeccaEntity.init

  - Defined in src/becca/entities/battribute.ts:65

### isAutoLink

- isAutoLink(): boolean

  #### Returns boolean

  - Defined in src/becca/entities/battribute.ts:111

### isDefinition

- isDefinition(): boolean

  #### Returns boolean

  - Defined in src/becca/entities/battribute.ts:147

### markAsDeleted

- markAsDeleted(deleteId?: null | string): void

  Mark the entity as (soft) deleted. It will be completely erased later.

  This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.

  #### Parameters

  - deleteId: null | string = null

  #### Returns void

  Inherited from AbstractBeccaEntity.markAsDeleted

  - Defined in src/becca/entities/abstract_becca_entity.ts:277

### markAsDeletedSimple

- markAsDeletedSimple(): void

  #### Returns void

  Inherited from AbstractBeccaEntity.markAsDeletedSimple

  - Defined in src/becca/entities/abstract_becca_entity.ts:303

### `Protected` putEntityChange

- putEntityChange(isDeleted: boolean): void

  #### Parameters

  - isDeleted: boolean

  #### Returns void

  Inherited from AbstractBeccaEntity.putEntityChange

  - Defined in src/becca/entities/abstract_becca_entity.ts:51

### save

- save(opts?: {}): this

  Saves entity - executes SQL, but doesn't commit the transaction on its own

  #### Parameters

  - `Optional` opts: {}

  #### Returns this

  Inherited from AbstractBeccaEntity.save

  - Defined in src/becca/entities/abstract_becca_entity.ts:103

### update

- update(__namedParameters: any): BAttribute

  #### Parameters

  - __namedParameters: any

  #### Returns BAttribute

  - Defined in src/becca/entities/battribute.ts:52

### updateFromRow

- updateFromRow(row: AttributeRow ): void

  #### Parameters

  - row: AttributeRow

  #### Returns void

  Overrides AbstractBeccaEntity.updateFromRow

  - Defined in src/becca/entities/battribute.ts:48

### validate

- validate(): void

  #### Returns void

  - Defined in src/becca/entities/battribute.ts:88