简体   繁体   English

Like链接在Socialengine中的工作方式

[英]How Like link works in Socialengine

I am working in social engine and developing a plugin and widget in social engine. 我正在社交引擎中工作,并在社交引擎中开发插件和小部件。 Say this plugin is about car so I want that on listing of my all cars, users can like the car. 说这个插件是关于car所以我希望所有汽车上市时,用户都可以like汽车。

I have seen in code that request is sent on activity/index/like with action_id as param. 我在代码中看到请求是在activity/index/like上发送的, activity/index/like action_id作为参数。 This is the id which is liked by user. 这是用户喜欢的ID。 Now what I have understood that each of your car entry must be present in engine4_activity_actions table. 现在,我了解到,您的每辆车条目都必须存在于engine4_activity_actions表中。

Again as for as I have understood the following fields are important in that table 再次,据我所知,该表中的以下字段很重要

type | subject_type | subject_id | object_type | object_id

I think I can put mycar in type column, user in subject_type , user_id in subject_id But what is object_type and object_id? 我想可以将mycar放在type列中,将user放在subject_type ,将user_id放在subject_id但是object_type和object_id是什么?

First I need to know either my understanding is rite or not? 首先,我需要知道我的理解是不是仪式? If yes then what I put in above two columns, Or then what is the correct way to accomplish this task? 如果是,那么我在上面两栏中输入的内容,或者完成该任务的正确方法是什么?

In the table engine4_activity_actions, the type is used to express the action type, for example "like_car" (you have to define it in the engine4_activity_actionTypes table). 在表engine4_activity_actions中,该类型用于表示操作类型,例如“ like_car”(您必须在engine4_activity_actionTypes表中对其进行定义)。

subject_type: user
subject_id: user_id
object_type: mycar
object_id: car_id

Hope this helps you much. 希望这对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM