ebook img

Programming Drupal 7 Entities PDF

134 Pages·2013·3.201 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Programming Drupal 7 Entities

Programming Drupal 7 Entities Expose local or remote data as Drupal 7 entities and build custom solutions Sammy Spets BIRMINGHAM - MUMBAI Programming Drupal 7 Entities Copyright © 2013 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: June 2013 Production Reference: 1190613 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78216-652-8 www.packtpub.com Cover Image by Suresh Mogre ([email protected]) Credits Author Project Coordinator Sammy Spets Suraj Bist Reviewers Proofreader James Roughton Dirk Manuel Michelle Williamson Indexer Priya Subramani Acquisition Editor James Jones Graphics Ronak Dhruv Lead Technical Editor Harsha Bharwani Production Coordinator Kirtee Shingan Technical Editors Sanhita Sawant Dennis John Cover Work Kirtee Shingan About the Author Since 2004, Sammy Spets has been finding pleasure in his life making Drupal do wild things. During that time, Sammy volunteered to be a core maintainer for Drupal 6 and a maintainer of the ecommerce module, which was the commerce module of choice way back when. For the ecommerce module, Sammy made design changes to the payment system, built a few modules to support payment gateways, and added PostgreSQL support, among other things. In 2008, IDG Australia contracted Sammy to design and lead the development of a hybrid Drupal/legacy platform. The platform allowed IDG developers to gradually migrate their websites and web applications over to Drupal 6, which was still in beta. In addition to the platform, Sammy was tasked with creating a module suite for the IDG staff to create surveys and reports on them. This module suite was built prior to webform, and leveraged the power of the Drupal 6 Form API in all its glory. Sammy also trained IDG developers to develop modules and themes in Drupal 6. Early in 2009, a short contract with Demonz Media in Sydney, Australia brought about some patches to Ubercart, which Demonz gladly contributed back to the community. Following that, Sammy travelled to Louisville, Kentucky, USA where he contributed code to improve the developer experience for developers extending Ubercart by using its API. Ryan Szrama introduced Sammy to Chick-fil-A and Lyle Mantooth introduced Sammy to Korean food and some amazing fried chicken. In 2011, Sammy joined the Magicspark team, building Drupal sites and maintaining servers. During this time, Sammy built a services platform to feed webform data to Marketo and LoopFuse from client Drupal sites via Magicspark's servers. In addition to this, Sammy redeveloped the UI on the Where to Buy page of the Redwood Systems website using OpenLayers mapping. Aside from the geeky stuff, Sammy loves to cook, fine-tune recipes, play pool, carve turns on a snowboard, hit the gym, ride motorcycles, dine fine, and drink champagne. Programming Drupal 7 Entities, Packt Publishing, is the first book Sammy has authored. Sammy was the technical reviewer for Migrating to Drupal 7, Packt Publishing. Sammy can be contacted by e-mail at [email protected]. Acknowledgement I would like to thank Jason Chinn from Magicspark for his understanding, his belief in me, and giving me spare time to write this book. Thank you to my Mum, Anja Spets, for her unconditional support over the years. To my Dad, Raimo Spets; I know you would have been proud to see this book published; may you rest in peace. Thank you to Raija and Markku Tujula for taking care of my Mum. Thank you to Arphaphorn Phromput (Waew) for filling my life with peace, fun, and companionship. Last, but not least, I thank my great friends, Martijn Blankers and Job de Graaff, for pretending to be interested when listening to me rant about this book. You both are awesome! Beer time! About the Reviewers James Roughton, received his Bachelor of Science degree in Business Administration from Christopher Newport College and his Masters degree in Safety Science from Indiana University of Pennsylvania (IUP). In addition, he is a Certified Safety Professional (CSP), a Registered Canadian Safety Professional (R-CRSP), and a Certified Hazard Material Management (M-CHMM). He also holds several training certifications: Certified Environmental Trainer (CET) and a Certified Instructional Technologist (CIT) with a certification in Six Sigma Black Belt. He recently became certified as an InBound Marketer in Social media. He is an accomplished author and manages his own websites, www.safetycultureplus.com; and www.jamesroughton.com. He has received awards for his efforts in safety, and was named the Project Safe Georgia Safety Professional in 2008 and the Georgia ASSE Chapter Safety Professional of the Year (SPY) 1998-1999. James is an active member of the Safety Advisory Board of the Departments of Labor/Insurance of Georgia, and has been an adjunct instructor for several universities. James has been very active in developing expertise in social media productivity and its use in communication of safety culture and safety management system concepts and information. In his latest project, he as just co-authored a new book entitled Safety Culture: An Innovated Leadership Approach, Butterworth-Heinemann. You can use the following links to connect with him: • YouTube: http://www.youtube.com/subscription_center?add_ user=mrjamesroughton • Twitter: http://twitter.com/jamesroughton • LinkedIn: http://www.linkedin.com/in/jamesroughtoncsp • Google +: https://plus.google.com/u/0/102851102730471202754 James is an independent consultant on safety and social media productivity. He has previously reviewed another book on Drupal. Michelle Williamson began her journey with computers in 1994 as the result of a traumatizing mishap involving a 15-page graduate class paper and an unformatted floppy disk. She spent 5 years as a staunch Luddite before becoming obsessed with web development and technology in general. She has been a freelance web developer since 2000, starting out on Microsoft platforms, then drinking the open source Kool-Aid in 2008, and since then has devoted her time primarily to Drupal development. She's an incessant learner and is addicted to head-scratching challenges, and looks forward to experiencing the continued evolution of mobile technology. www.PacktPub.com Support files, eBooks, discount offers and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub. com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. TM http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why Subscribe? • Fully searchable across every book published by Packt • Copy and paste, print and bookmark content • On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access. Table of Contents Preface 1 Chapter 1: Understanding Entities 7 Introducing entities 8 Entity and solution modules 9 Introducing entity types, bundles, and fields 9 Types 10 Bundles 10 Fields 11 Drupal core entity structure 11 Powerful entity use cases 12 User profiles 12 Internationalization 13 Commerce products 13 Our use case 13 Summary 14 Chapter 2: Developing with Entity Metadata Wrappers 15 Introducing entity metadata wrappers 15 Creating an entity metadata wrapper object 16 Standard entity properties 17 Entity introspection 18 Using an entity metadata wrapper 18 Create 18 Drush commands 18 Code snippet 19 Retrieve 19 Drush commands 19 Code snippet 19

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.