static function getTypeId($type) { $webpage_type = WebpageTypes::findOne(array('conditions' => array("`name` = ?", $type))); if (!is_null($webpage_type)) { return $webpage_type->getId(); } else { return null; } }