37 lines
845 B
Plaintext
37 lines
845 B
Plaintext
type RelationshipsAdapter = class
|
|
public
|
|
function Create(_obj: Relationships);
|
|
function Init();
|
|
|
|
function GetRelationshipById(_key: string);
|
|
function SetRelationshipById(_key: string; _value: tslobj);
|
|
|
|
private
|
|
object_: Relationships;
|
|
relationship_hash_: tableArray;
|
|
end;
|
|
|
|
function RelationshipsAdapter.Create(_obj: Relationships);
|
|
begin
|
|
object_ := _obj;
|
|
relationship_hash_ := array();
|
|
{self.}Init();
|
|
end;
|
|
|
|
function RelationshipsAdapter.Init();
|
|
begin
|
|
elements := object_.Relationships();
|
|
for k,v in elements do
|
|
relationship_hash_[v.Id] := v;
|
|
end;
|
|
|
|
function RelationshipsAdapter.GetRelationshipById(_key: string);
|
|
begin
|
|
return relationship_hash_[_key];
|
|
end;
|
|
|
|
function RelationshipsAdapter.SetRelationshipById(_key: string; _value: tslobj);
|
|
begin
|
|
relationship_hash_[_key] := _value;
|
|
end;
|