Hi, I'm having some problems with my custom module, I have 2 entities: Article and ArticleControl with this definitions:
Article:
ArticleControl:
The issue is when I call /Article/%ID%/control I always get all the items instead of the items connected. What I'm missing?
Thanks
Article:
PHP Code:
{
"fields": {
"name": {
"type": "varchar",
"required": true
},
"createdAt": {
"type": "datetime",
"readOnly": true
},
"modifiedAt": {
"type": "datetime",
"readOnly": true
},
"createdBy": {
"type": "link",
"readOnly": true
},
"modifiedBy": {
"type": "link",
"readOnly": true
},
"assignedUser": {
"type": "link",
"required": true
},
"teams": {
"type": "linkMultiple"
}
},
"links": {
"createdBy": {
"type": "belongsTo",
"entity": "User"
},
"modifiedBy": {
"type": "belongsTo",
"entity": "User"
},
"assignedUser": {
"type": "belongsTo",
"entity": "User"
},
"teams": {
"type": "hasMany",
"entity": "Team",
"relationName": "EntityTeam"
},
"tasks": {
"type": "belongsTo",
"entity": "Task"
},
"control": {
"type": "hasChildren",
"entity": "ArticleControl",
"foreign": "parent"
}
},
"collection": {
"sortBy": "name",
"asc": false,
"boolFilters": ["onlyMy"]
}
}
PHP Code:
{
"fields": {
"data": {
"type": "text"
},
"status": {
"type": "enum",
"options": ["Pending", "Completed"],
"default": "Pending"
},
"createdAt": {
"type": "datetime",
"readOnly": true
}
},
"links": {
"control": {
"type": "belongsTo",
"entity": "Article"
}
},
"collection": {
"sortBy": "createdAt",
"asc": false
}
}
The issue is when I call /Article/%ID%/control I always get all the items instead of the items connected. What I'm missing?
Thanks
Comment