Home > Internet > Drupal > Entity Construction Kit (ECK), cara mudah membuat CRUD di Drupal 7

Entity Construction Kit (ECK), cara mudah membuat CRUD di Drupal 7

Drupal 7 mendukung penggunaan entities secara native (sudah dimasukkan dalam core).  Untuk penjelasan tentang entities silahkan berkunjung kesini atau kesini.

Pada artikel ini, saya akan menjelaskan sedikit tentang penggunaan entities, bundle, properties dan fields. Penjelasan dititik beratkan pada CRUD (Create, Read, Update, dan Delete) dalam entities.

Kalau dalam OOP anggap saja entity itu base class, bundle adalah extended class, properties & fields adalah class member. Sebelum melangkah lebih lanjut, pastikan modul Entity Construction Kit (eck) sudah terinstall termasuk dependensi-nya.

Eck dapat diakses melalui Structure -> Entity Type. Halaman ini akan menampilkan semua entity yang sudah dibuat, apabila belum ada, silahkan membuat entity terlebih dahulu melalui link yang tersedia. Tampilan form untuk membuat entity baru seperti berikut:

Pada entity dapat juga ditambahkan beberapa properti baru, seperti dibawah ini, saya menambahkan properti Jumlah roda:

Pada entity type Sepeda ini, saya tambahkan bundle baru yaitu sepeda berpenggerak, seperti pada gambar berikut:

Untuk masing-masing bundle, kita dapat menambahkan field yang berbeda. Karena pada hakikatnya, antar bundle itu masih ada kemiripan, tetapi ada juga pembedanya. Dalam contoh ini, saya menambahkan field Shifting Lever pada bundle sepeda, dan menambahkan Tipe penggerak pada bundle sepeda berpenggerak, seperti terlihat pada gambar berikut.


Okay, konfigurasi selesai, sekarang bagaimana memasukkan datanya? Gampang, klik saja tombil Add “Bundle name” dalam Entity List, maka akan ditampilkan form untuk menambahkan data, seperti berikut:


Tampikan untuk edit data juga akan mirip gambar diatas. Bagaimana tampilan list datanya? By default, tampilan list data di ECK kurang informatif, seperti terlihat pada gambar berikut:

Tetapi jangan khawatir, drupal punya solusinya untuk menampilkan list data dengan lebih bagus, salah satunya menggunakan modul Views. Contoh tampilan data menggunakan views sebagai berikut (list dari gabungan dua bundle):

Untuk cara menggunakan views, tidak akan saya bahas disini. Mungkin lain waktu 🙂

Mudah sekali khan? Bahkan tanpa coding sama sekali untuk membuat CRUD. Untuk pengembangan lebih lanjut, silahkan dieksplore sendiri (contohnya untuk: field validation, reporting, export data, relasi antar entity).

You may also like
Tutorial Mengganti Keyboard Pada Laptop Acer Aspire 4920
Cara Memasang Temper Glass di Smartphone
Drupal: Bulk Insert
Ciyeee, Drupal dan WordPress minta update barengan.

15 Responses

  1. I must express my thanks to you for rescuing me from this trouble. After looking throughout the the web and coming across notions that were not pleasant, I believed my life was gone. Existing minus the answers to the problems you have solved by way of your main website is a serious case, as well as ones that would have negatively damaged my entire career if I hadn’t discovered your blog post. Your own competence and kindness in dealing with all the stuff was priceless. I am not sure what I would have done if I hadn’t discovered such a point like this. I can also now relish my future. Thanks very much for your expert and effective help. I will not be reluctant to refer your web sites to anybody who desires care about this subject.

  2. Aw, this was a really nice post. In thought I wish to put in writing like this moreover ?taking time and actual effort to make a very good article?however what can I say?I procrastinate alot and not at all seem to get one thing done.

  3. I’m just commenting to let you be aware of of the outstanding encounter my friend’s child undergone checking your site. She realized numerous issues, which include what it’s like to possess an incredible teaching style to make many others quite simply grasp some problematic issues. You undoubtedly surpassed our expectations. Thanks for giving these essential, trustworthy, revealing and in addition unique tips on your topic to Tanya.

  4. I’m often to blogging and i actually admire your content. The article has actually peaks my interest. I’m going to bookmark your site and hold checking for new information.

  5. I in addition to my pals have been reading through the best tips and tricks on your web site and then all of a sudden I had an awful feeling I had not thanked you for them. The guys appeared to be certainly passionate to see them and already have in fact been having fun with them. Thank you for actually being very considerate and then for getting this sort of beneficial subject areas millions of individuals are really eager to learn about. My personal honest regret for not saying thanks to earlier.

  6. I would like to show thanks to the writer just for rescuing me from this type of problem. Because of exploring through the world wide web and meeting tips that were not beneficial, I was thinking my entire life was well over. Existing minus the solutions to the problems you have fixed by means of the short post is a crucial case, as well as those which could have in a negative way affected my entire career if I had not noticed the website. Your main understanding and kindness in handling all things was excellent. I don’t know what I would’ve done if I had not encountered such a solution like this. I am able to at this time look forward to my future. Thanks so much for the skilled and sensible guide. I won’t think twice to suggest the website to any person who would need care about this topic.

  7. I enjoy you because of all of your work on this website. Kim loves making time for research and it’s really easy to see why. Most of us hear all concerning the compelling tactic you produce simple secrets by means of this website and as well attract contribution from some others on the point then my girl has been learning a great deal. Have fun with the remaining portion of the year. You are performing a great job.

  8. I as well as my guys appeared to be examining the excellent thoughts found on your web page then all of a sudden got a horrible feeling I had not thanked the website owner for those strategies. My boys came for this reason thrilled to read through them and already have sincerely been enjoying those things. Many thanks for turning out to be very kind as well as for making a decision on this kind of ideal subject areas most people are really desirous to learn about. Our own honest regret for not expressing appreciation to you earlier.

  9. I have to express my respect for your generosity in support of persons that really need assistance with this particular niche. Your real dedication to getting the solution along has been unbelievably good and have specifically empowered guys and women much like me to arrive at their objectives. Your amazing useful guidelines implies a whole lot to me and far more to my mates. Thanks a lot; from everyone of us.

  10. My spouse and i ended up being very relieved Michael could round up his analysis through your precious recommendations he gained through your web pages. It is now and again perplexing just to be giving freely information and facts which the rest could have been selling. So we take into account we have you to appreciate for that. Those illustrations you’ve made, the simple site navigation, the friendships you help instill – it’s all unbelievable, and it’s aiding our son in addition to the family do think the subject matter is interesting, which is certainly seriously fundamental. Many thanks for all the pieces!

  11. I and also my pals were found to be viewing the great things found on your web page and then quickly developed a terrible feeling I had not thanked the site owner for them. These men were definitely absolutely very interested to read them and have in truth been using these things. Appreciation for turning out to be really accommodating and also for deciding on such essential areas millions of individuals are really desirous to understand about. Our sincere apologies for not expressing gratitude to sooner.

  12. Thank you so much for giving everyone an exceptionally pleasant opportunity to read in detail from this blog. It’s usually so enjoyable and as well , full of fun for me and my office colleagues to search your website no less than thrice weekly to read the fresh issues you have got. And of course, I’m also at all times motivated with your effective methods served by you. Certain 4 areas in this post are rather the most effective we have all had.

  13. I enjoy you because of all your work on this web site. My niece delights in working on investigation and it is obvious why. Almost all notice all regarding the compelling method you render both useful and interesting secrets on your blog and improve contribution from website visitors on the subject and my girl is certainly becoming educated so much. Take pleasure in the rest of the new year. Your conducting a splendid job.

  14. I precisely had to thank you very much once again. I am not sure the things I would have made to happen without the entire opinions provided by you about such area. It was before a daunting matter in my circumstances, but spending time with a new professional tactic you processed it forced me to leap for happiness. I’m just happier for the help and hope that you know what an amazing job you have been carrying out teaching many people using your web blog. I’m certain you haven’t met all of us.

Leave a Reply