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.

64 Responses

  1. I truly wanted to make a small remark to be able to express gratitude to you for all the marvelous suggestions you are placing at this site. My long internet investigation has at the end been rewarded with professional facts and strategies to write about with my neighbours. I ‘d suppose that most of us visitors are rather endowed to be in a good website with so many awesome individuals with very beneficial guidelines. I feel quite fortunate to have seen the web pages and look forward to tons of more fun moments reading here. Thanks once more for all the details.

  2. I simply wished to say thanks once again. I am not sure the things that I would have carried out without those opinions shared by you over my subject matter. It truly was a frightening crisis in my opinion, however , seeing the very professional strategy you managed it forced me to jump for fulfillment. I will be thankful for the support and even pray you recognize what a great job you’re getting into educating many people all through your website. I’m certain you haven’t encountered all of us.

  3. Thank you a lot for giving everyone remarkably marvellous possiblity to check tips from here. It really is so ideal and also full of a great time for me personally and my office fellow workers to search your website minimum thrice a week to find out the newest issues you have. And indeed, I am also at all times fascinated with the perfect tactics you serve. Certain two areas in this article are absolutely the most impressive we’ve ever had.

  4. I enjoy you because of each of your work on this web site. Betty delights in working on internet research and it’s easy to see why. A number of us hear all about the compelling manner you deliver insightful tips and hints through the web site and welcome response from website visitors about this topic plus our child is being taught a great deal. Enjoy the remaining portion of the year. You’re performing a useful job.

  5. I needed to send you one tiny word just to thank you once again considering the remarkable tips you have shown in this article. It was open-handed of people like you to give unreservedly exactly what many people could have distributed for an ebook to end up making some bucks on their own, mostly seeing that you could possibly have done it if you ever considered necessary. The points as well served like the great way to recognize that many people have a similar desire just as my very own to realize whole lot more with regards to this problem. I am sure there are numerous more enjoyable moments ahead for those who find out your website.

  6. Thank you so much for providing individuals with a very remarkable possiblity to read from this site. It is often so useful plus stuffed with a good time for me and my office co-workers to visit your blog at least three times in 7 days to read the fresh issues you will have. And definitely, I am just at all times amazed considering the unbelievable tips and hints you serve. Some 4 areas in this article are in truth the most impressive we have all had.

  7. Youre so cool! I dont suppose Ive read something like this before. So good to find somebody with some unique thoughts on this subject. realy thanks for beginning this up. this web site is something that is needed on the net, somebody with just a little originality. helpful job for bringing something new to the web!

  8. Thanks so much for giving everyone such a marvellous chance to read from this site. It really is so lovely and also packed with amusement for me and my office fellow workers to visit your blog at minimum 3 times in one week to read through the latest things you have got. And lastly, I am also actually happy with the awesome ideas you give. Some 1 facts in this posting are truly the most suitable we have all ever had.

  9. There are actually a number of particulars like that to take into consideration. That could be a nice point to deliver up. I supply the thoughts above as general inspiration however clearly there are questions like the one you carry up where the most important thing might be working in trustworthy good faith. I don?t know if best practices have emerged round issues like that, but I am positive that your job is clearly identified as a fair game. Each boys and girls really feel the impact of just a moment? pleasure, for the remainder of their lives.

  10. I am also commenting to make you be aware of what a fabulous experience our girl obtained going through your webblog. She came to understand many issues, most notably how it is like to have an awesome giving mood to have other individuals clearly know just exactly various specialized issues. You actually exceeded our own expected results. Thank you for rendering these interesting, safe, revealing and even cool tips on the topic to Emily.

  11. Aw, this was a very nice post. In idea I want to put in writing like this additionally ?taking time and actual effort to make a very good article?but what can I say?I procrastinate alot and not at all seem to get something done.

  12. Having read this I thought it was very informative. I appreciate you taking the time and effort to put this article together. I once again find myself spending way to much time both reading and commenting. But so what, it was still worth it!

  13. I discovered your weblog web site on google and check a few of your early posts. Continue to maintain up the very good operate. I just further up your RSS feed to my MSN News Reader. Searching for forward to reading extra from you afterward!?

  14. That is the proper weblog for anybody who wants to seek out out about this topic. You understand a lot its almost arduous to argue with you (not that I really would want?aHa). You undoubtedly put a new spin on a subject thats been written about for years. Great stuff, simply great!

Leave a Reply