Symfony: Control Model->save() function to perform INSERT or UPDATE

advertisement

In Symfony Framework, Model->save() function is clever enough to determine to use INSERT or UPDATE for the query. But i’ve tried many ways to perform an UPDATE for my record but failed. It keep INSERT new record. Finally i found the solution to control the Model->save() function to perform INSERT or UPDATE.

Just a simple example:-
Assume there is a User table where ID is the primary key, and there is a user record with id = 5, now we perform the code below, it should be smart enough to perform UPDATE but NO!, the code below will INSERT a new record.
Continue reading Symfony: Control Model->save() function to perform INSERT or UPDATE »

How to type chinese character in Ms Windows? – Google PinYin

Always been ask how to type chinese character in Ms Win. To type chinese in windows, you can download you can download Google PinYin Chinese input method for free. Google PinYin chinese input method is release by Google Lab (China). It’s a free Chinese input method you can install for your Ms Windows machine.

Google PinYin Chinese Input Method has many good features including:-

  • Smart sentence building – Google PinYin Input Method builds sentences for you, reduce the time to choose the correct words.
  • Popular words – Powered by Google database, Google PinYin Input Method automatically updates the latest buzz words in Internet.
  • Sync – You can sync your input habit and personalized words with Google account and apply it on other computer.
  • One-click search – It is Google. You can search any word directly from the Google PinYin Input Method toolbar
  • English input – Google PinYin Input Method gives English words suggestion when you type english characters. No need to switch input method.

Once download and installed, you can activate google pinyin chinese input method by ALT + Left Shift.
Continue reading How to type chinese character in Ms Windows? – Google PinYin »

Arrow key not working in vi / vim – Mac OS

Using Mac OS X for the past few days for my work, i notice my arrow key not working in vi editor. One of my colleague help me to solve this arrow key problem in vi.

Here’s the solution for those who has arrow key not working in vi / vim for Mac OS:-
Continue reading Arrow key not working in vi / vim – Mac OS »