Everyone and their mom have been using Git and GitHub for a while, but I’m just breaking down and using it… I have been slow to adopt because SVN worked for me fine (until I had to merge branches) and I don’t like to pay for storage space. But I continue to be impressed by it’s functionality and ease of use, so I’m going to move our work repositories over (needing a Large account probably) but I think it will be worth it.
Oliver has been feeling a bit sick for a couple of days, and it was acute yesterday early afternoon – he was doing the “I’m in pain” cry for a half an hour straight and was inconsolable. Very unusual for him. So we made an appointment to see the Pediatrician and by the time we got in there (~3 hours later) he seemed pretty normal, though really tired still because he is sick and doing all the extra crying, but sleeping and eating ok again.
I added an update to CakePHP Book: beforeSave()
Also, if you add a primary key which would turn an “insert” into an “update” within beforeSave() you’ll need to set $this->__exists = true;… the call to $this->exists(); happens in model.php before the callback to beforeSave().
function beforeSave() { if (!isset($this->data[$this->name]['id']) && isset($this->data[$this->name]['unique_field'])) { $found = $this->find("first",array( "recursive" => -1, "fields" => array("id"), "conditions" => array("unique_field" => $this->data[$this->name]['unique_field']))); if (!empty($found) && isset($found[$this->name]['id'])) { $this->id = $this->data[$this->name]['id'] = $found[$this->name]['id']; $this->__exists = true; } } return parent::beforeSave(); } That’s been confusing me a bit recently – setting the ID of a row within beforesave() should change the save to an update, but it was trying to insert with a specified ID and thus, failing… glad to have a simple solution that makes sense… hope that helps someone else…
Alan’s Google Profile, now updated with Buzz activity, searchable, and pulling content from various feeds, including flickr, facebook, twitter, etc…
If you don’t see this as “competition” for Facebook (et. al.) then you’re not seeing the same thing I am.
I personally love it, esp. the publicly searchable aspects and the integration into the gmail interface but I might stop using it if other people don’t or if it can’t work two-way with facebook….
Most of you have heard from the grapevine or facebook (this generation’s grapevine) that our son, Oliver Jackson Blount, was born on 2010-02-02 @ 14:35 EST. He was 9 pounds 15 ounces and 23 inches (they measured twice to be sure).
We had a home birth with 2 midwives and an apprentice, a doula, Anita’s mom (former NICU nurse) and sister Virginia (new nurse) in attendance… of yeah, and me. The decision to have a home birth was one we took very seriously and subsequently are very happy with; it being unusual is often the topic of conversation… but I can summarize with the following: We had a normal and healthy fetus inside a normal and healthy mom, everything looking like it would progress as “low risk” we choose to stay at home with the support of professionals vs.